diff --git a/README.md b/README.md
index b42d440c031..892a72df9be 100644
--- a/README.md
+++ b/README.md
@@ -227,7 +227,7 @@ redirects:
- servicecontrol/sc-si
- servicecontrol/debugging-servicecontrol
related:
-- samples/azure/shared-host
+- servicecontrol/installation
---
```
diff --git a/nservicebus/azure/index.md b/nservicebus/azure/index.md
index f5535ba172c..249bc4d4ecc 100644
--- a/nservicebus/azure/index.md
+++ b/nservicebus/azure/index.md
@@ -8,19 +8,16 @@ NServiceBus helps create distributed .NET systems not only on premises but also
## Hosting
- * [Hosting in Azure Cloud Services](/nservicebus/hosting/cloud-services-host/)
- * [Shared Hosting in Azure Cloud Services](/samples/azure/shared-host/)
+ * [Hosting in Azure WebJobs](/samples/azure/webjob-host/)
+ * [Azure Cloud Showcase](/samples/showcase/cloud-azure/) using WebApps and WebJobs
+ * [Hosting in Service Fabric](/nservicebus/hosting/service-fabric-hosting/)
+ * [Hosting in Azure Cloud Services](/nservicebus/hosting/cloud-services-host/) (deprecated)
## Serverless
* [Azure Functions with Azure Service Bus](/nservicebus/hosting/azure-functions/service-bus.md)
* [Azure Functions with Azure Storage Queues](/previews/azure-functions-storage-queues.md)
-### Self-hosting
-
- * [Azure App Service](/samples/showcase/cloud-azure/) using WebApps and WebJobs
- * [Service Fabric](/nservicebus/hosting/service-fabric-hosting/)
-
## Transports
* [Azure Service Bus Transport](/transports/azure-service-bus/)
diff --git a/nservicebus/hosting/cloud-services-host/cloudserviceshost-deprecated-warning.include.md b/nservicebus/hosting/cloud-services-host/cloudserviceshost-deprecated-warning.include.md
index 3f59d2e0829..106cde137da 100644
--- a/nservicebus/hosting/cloud-services-host/cloudserviceshost-deprecated-warning.include.md
+++ b/nservicebus/hosting/cloud-services-host/cloudserviceshost-deprecated-warning.include.md
@@ -1 +1 @@
-WARNING: The NServiceBus Azure Host package is deprecated as of version 9. Instead use [self-hosting in Azure Cloud Services](/samples/azure/self-host). Refer to the [upgrade guide](/nservicebus/upgrades/acs-host-7to8.md) for further details.
+WARNING: The NServiceBus Azure Host package is deprecated as of Version 9 as Microft has deprecated the Cloud Service hosting model. Users are recommended to switch to a different cloud hosting model.
diff --git a/nservicebus/hosting/cloud-services-host/index.md b/nservicebus/hosting/cloud-services-host/index.md
index 0eb2320f632..75976b189bb 100644
--- a/nservicebus/hosting/cloud-services-host/index.md
+++ b/nservicebus/hosting/cloud-services-host/index.md
@@ -7,7 +7,6 @@ redirects:
- nservicebus/azure/hosting-nservicebus-in-windows-azure-cloud-services
- nservicebus/windows-azure-transport
related:
- - samples/azure/shared-host
- nservicebus/lifecycle
reviewed: 2020-04-26
---
@@ -32,7 +31,7 @@ snippet: AzureServiceBusTransportWithAzureHost
Partial: Worker
-When self-hosting, everything can be configured using the API and extension methods available in the NServiceBus Azure-related packages; it's not required to reference the hosting package. To self-host an endpoint, add the required configuration to the role entry point. For more information on how to self-host in Cloud Services, refer to the Cloud Services [self-hosting sample](/samples/azure/self-host/).
+When self-hosting, everything can be configured using the API and extension methods available in the NServiceBus Azure-related packages; it's not required to reference the hosting package. To self-host an endpoint, add the required configuration to the role entry point.
## Cloud Services - Web Roles
diff --git a/nservicebus/hosting/cloud-services-host/shared-hosting.md b/nservicebus/hosting/cloud-services-host/shared-hosting.md
index 463d2ac31ef..f3bf708d2ee 100644
--- a/nservicebus/hosting/cloud-services-host/shared-hosting.md
+++ b/nservicebus/hosting/cloud-services-host/shared-hosting.md
@@ -1,8 +1,6 @@
---
title: Shared Hosting in Azure
summary: Using Azure cloud services to host multiple NServiceBus endpoints on a shared pool of machines.
-related:
- - samples/azure/shared-host
redirects:
- nservicebus/shared-hosting-nservicebus-in-windows-azure-cloud-services
- nservicebus/azure/shared-hosting-nservicebus-in-windows-azure-cloud-services
diff --git a/nservicebus/upgrades/acs-host-7to8.md b/nservicebus/upgrades/acs-host-7to8.md
index cdccd0108b4..47aef0d8603 100644
--- a/nservicebus/upgrades/acs-host-7to8.md
+++ b/nservicebus/upgrades/acs-host-7to8.md
@@ -5,23 +5,13 @@ reviewed: 2021-07-23
component: CloudServicesHost
related:
- nservicebus/upgrades/6to7
- - samples/azure/self-host
isUpgradeGuide: true
upgradeGuideCoreVersions:
- 6
- 7
---
-The NServiceBus Azure Host will be deprecated as of Version 9 and users are recommended to switch to self-hosting for new endpoints. Upgrading existing endpoints is still supported for Version 8.
-
-include: host-deprecate
-
-
-## Migrating procedure
-
-See the [self-hosting sample](/samples/azure/self-host/) for details. For multi-hosting it is recommended to apply self-hosting with multiple endpoints similar to the [multi-hosting sample](/samples/hosting/generic-multi-hosting).
-
-If process isolation is required between the endpoints it is advised to stay with the latest version of the cloud host. Process isolation will be addressed in the upgrade guides when the host is fully deprecated.
+The NServiceBus Azure Host package is deprecated as of Version 9 as Microft has deprecated the Cloud Service hosting model. Users are recommended to switch to a different cloud hosting model.
### Configuration
diff --git a/samples/azure/self-host/Core_7/AzureSelfHosting.sln b/samples/azure/self-host/Core_7/AzureSelfHosting.sln
deleted file mode 100644
index a2182cf9c51..00000000000
--- a/samples/azure/self-host/Core_7/AzureSelfHosting.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29728.190
-MinimumVisualStudioVersion = 15.0.26730.12
-Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "HostCloudService", "HostCloudService\HostCloudService.ccproj", "{CD8D25E1-7D63-49DE-A109-4ABF98731C24}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostWorker", "HostWorker\HostWorker.csproj", "{07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CD8D25E1-7D63-49DE-A109-4ABF98731C24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CD8D25E1-7D63-49DE-A109-4ABF98731C24}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3BF8C8EA-0C13-417F-A21D-75A6EEBA2F62}
- EndGlobalSection
-EndGlobal
diff --git a/samples/azure/self-host/Core_7/AzureSelfHosting.sln.DotSettings b/samples/azure/self-host/Core_7/AzureSelfHosting.sln.DotSettings
deleted file mode 100644
index 7926067e7dc..00000000000
--- a/samples/azure/self-host/Core_7/AzureSelfHosting.sln.DotSettings
+++ /dev/null
@@ -1,6 +0,0 @@
-
- ..\..\..\..\..\tools\Shared.DotSettings
- True
- True
- 1
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/HostCloudService.ccproj b/samples/azure/self-host/Core_7/HostCloudService/HostCloudService.ccproj
deleted file mode 100644
index 42e948b7450..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/HostCloudService.ccproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 2.9
- cd8d25e1-7d63-49de-a109-4abf98731c24
- Library
- Properties
- HostCloudService
- HostCloudService
- True
- HostCloudService
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HostWorker
- {07fdac8f-a69d-4a5c-aba1-daec52a649fb}
- True
- Worker
- HostWorker
- True
-
-
-
-
- 14.0
- $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/HostWorkerContent/diagnostics.wadcfgx b/samples/azure/self-host/Core_7/HostCloudService/HostWorkerContent/diagnostics.wadcfgx
deleted file mode 100644
index 17c38f28f0e..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/HostWorkerContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/SenderContent/diagnostics.wadcfgx b/samples/azure/self-host/Core_7/HostCloudService/SenderContent/diagnostics.wadcfgx
deleted file mode 100644
index 17c38f28f0e..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/SenderContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Cloud.cscfg b/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Cloud.cscfg
deleted file mode 100644
index 50aab3d297d..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Cloud.cscfg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Local.cscfg b/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Local.cscfg
deleted file mode 100644
index 6e70eeab56d..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/ServiceConfiguration.Local.cscfg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/ServiceDefinition.csdef b/samples/azure/self-host/Core_7/HostCloudService/ServiceDefinition.csdef
deleted file mode 100644
index af43ba92f2c..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/ServiceDefinition.csdef
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx b/samples/azure/self-host/Core_7/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx
deleted file mode 100644
index 6f86bae755b..00000000000
--- a/samples/azure/self-host/Core_7/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- devstoreaccount1
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/AsyncLazy.cs b/samples/azure/self-host/Core_7/HostWorker/AsyncLazy.cs
deleted file mode 100644
index c1c04f06287..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/AsyncLazy.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-
-public class AsyncLazy : Lazy>
-{
- public AsyncLazy(Func> taskFactory) :
- base(() => Task.Factory.StartNew(taskFactory).Unwrap())
- { }
-
- public TaskAwaiter GetAwaiter() { return Value.GetAwaiter(); }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/HostWorker.csproj b/samples/azure/self-host/Core_7/HostWorker/HostWorker.csproj
deleted file mode 100644
index f088b6f21d8..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/HostWorker.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}
- Library
- Properties
- HostWorker
- HostWorker
- v4.6.1
- 512
- Worker
-
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
- Always
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/LogEntry.cs b/samples/azure/self-host/Core_7/HostWorker/LogEntry.cs
deleted file mode 100644
index d5fe86962fc..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/LogEntry.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using Microsoft.WindowsAzure.Storage.Table;
-
-class LogEntry :
- TableEntity
-{
- public LogEntry(string endpoint, string message)
- {
- PartitionKey = endpoint;
- RowKey = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- Message = message;
- }
-
- public string Message { get; set; }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/MyMessage.cs b/samples/azure/self-host/Core_7/HostWorker/MyMessage.cs
deleted file mode 100644
index 2440a915a48..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/MyMessage.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-using NServiceBus;
-
-public class MyMessage :
- ICommand
-{
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/MyMessageHandler.cs b/samples/azure/self-host/Core_7/HostWorker/MyMessageHandler.cs
deleted file mode 100644
index efc0aba754d..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/MyMessageHandler.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Threading.Tasks;
-using NServiceBus;
-
-public class MyMessageHandler :
- IHandleMessages
-{
- public Task Handle(MyMessage message, IMessageHandlerContext context)
- {
- return VerificationLogger.Write("MyMessageHandler", "Got MyMessage.");
- }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/NServiceBusFeatures.cs b/samples/azure/self-host/Core_7/HostWorker/NServiceBusFeatures.cs
deleted file mode 100644
index 5dae0f481e0..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/NServiceBusFeatures.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using NServiceBus;
-using NServiceBus.Features;
-
-public static class NServiceBusFeatures
-{
- public static void DisableNotUsedFeatures(this EndpointConfiguration endpointConfiguration)
- {
- endpointConfiguration.DisableFeature();
- var recoverability = endpointConfiguration.Recoverability();
- recoverability.Delayed(
- customizations: settings =>
- {
- settings.NumberOfRetries(0);
- });
- endpointConfiguration.DisableFeature();
- }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/SafeRoleEnvironment.cs b/samples/azure/self-host/Core_7/HostWorker/SafeRoleEnvironment.cs
deleted file mode 100644
index 22d588fa7ae..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/SafeRoleEnvironment.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Reflection;
-
-[DebuggerNonUserCode]
-static class SafeRoleEnvironment
-{
- static bool isAvailable = true;
- static Type roleEnvironmentType;
- static Type roleInstanceType;
- static Type roleType;
- static Type localResourceType;
-
- static SafeRoleEnvironment()
- {
- try
- {
- TryLoadRoleEnvironment();
- }
- catch
- {
- isAvailable = false;
- }
-
- }
-
- public static bool IsAvailable => isAvailable;
-
- public static string CurrentRoleInstanceId
- {
- get
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this property");
- }
-
- var instance = roleEnvironmentType.GetProperty("CurrentRoleInstance").GetValue(null, null);
- return (string)roleInstanceType.GetProperty("Id").GetValue(instance, null);
- }
- }
-
- public static string DeploymentId
- {
- get
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this property");
- }
-
- return (string)roleEnvironmentType.GetProperty("DeploymentId").GetValue(null, null);
- }
- }
- public static string CurrentRoleName
- {
- get
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this property");
- }
-
- var instance = roleEnvironmentType.GetProperty("CurrentRoleInstance").GetValue(null, null);
- var role = roleInstanceType.GetProperty("Role").GetValue(instance, null);
- return (string)roleType.GetProperty("Name").GetValue(role, null);
- }
- }
-
- public static string GetConfigurationSettingValue(string name)
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this method");
- }
-
- return (string)roleEnvironmentType.GetMethod("GetConfigurationSettingValue").Invoke(null, new object[] { name });
- }
-
- public static bool TryGetConfigurationSettingValue(string name, out string setting)
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this method");
- }
-
- setting = string.Empty;
- try
- {
- setting = (string)roleEnvironmentType.GetMethod("GetConfigurationSettingValue").Invoke(null, new object[] { name });
- return !string.IsNullOrEmpty(setting);
- }
- catch
- {
- return false;
- }
- }
-
- public static void RequestRecycle()
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this method");
- }
-
- roleEnvironmentType.GetMethod("RequestRecycle").Invoke(null, null);
- }
-
- public static string GetRootPath(string name)
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this method");
- }
-
- var o = roleEnvironmentType.GetMethod("GetLocalResource").Invoke(null, new object[] { name });
- return (string)localResourceType.GetProperty("RootPath").GetValue(o, null);
- }
-
- public static bool TryGetRootPath(string name, out string path)
- {
- if (!IsAvailable)
- {
- throw new Exception("Role environment is not available, check IsAvailable before calling this method");
- }
-
- path = string.Empty;
-
- try
- {
- path = GetRootPath(name);
- return path != null;
- }
- catch
- {
- return false;
- }
- }
-
- static void TryLoadRoleEnvironment()
- {
- var serviceRuntimeAssembly = TryLoadServiceRuntimeAssembly();
- if (!isAvailable)
- {
- return;
- }
-
- TryGetRoleEnvironmentTypes(serviceRuntimeAssembly);
- if (!isAvailable)
- {
- return;
- }
-
- isAvailable = IsAvailableInternal();
- }
-
- static void TryGetRoleEnvironmentTypes(Assembly serviceRuntimeAssembly)
- {
- try
- {
- roleEnvironmentType = serviceRuntimeAssembly.GetType("Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment");
- roleInstanceType = serviceRuntimeAssembly.GetType("Microsoft.WindowsAzure.ServiceRuntime.RoleInstance");
- roleType = serviceRuntimeAssembly.GetType("Microsoft.WindowsAzure.ServiceRuntime.Role");
- localResourceType = serviceRuntimeAssembly.GetType("Microsoft.WindowsAzure.ServiceRuntime.LocalResource");
- }
- catch (ReflectionTypeLoadException)
- {
- isAvailable = false;
- }
- }
-
- static bool IsAvailableInternal()
- {
- try
- {
- return (bool)roleEnvironmentType.GetProperty("IsAvailable").GetValue(null, null);
- }
- catch
- {
- return false;
- }
- }
-
- static Assembly TryLoadServiceRuntimeAssembly()
- {
- try
- {
-#pragma warning disable 618
- var ass = Assembly.LoadWithPartialName("Microsoft.WindowsAzure.ServiceRuntime");
-#pragma warning restore 618
- isAvailable = ass != null;
- return ass;
- }
- catch (FileNotFoundException)
- {
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/VerificationLogger.cs b/samples/azure/self-host/Core_7/HostWorker/VerificationLogger.cs
deleted file mode 100644
index 524af03b294..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/VerificationLogger.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.WindowsAzure.ServiceRuntime;
-using Microsoft.WindowsAzure.Storage;
-using Microsoft.WindowsAzure.Storage.Table;
-
-public static class VerificationLogger
-{
- static AsyncLazy lazyTable;
- static SemaphoreSlim semaphore = new SemaphoreSlim(1);
-
- static VerificationLogger()
- {
- lazyTable = new AsyncLazy(async () =>
- {
- var cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("HostWorker.ConnectionString"));
- var cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
- var t = cloudTableClient.GetTableReference("SelfHostedEndpointsOutput");
- await t.CreateIfNotExistsAsync().ConfigureAwait(false);
- return t;
- });
- }
-
- public static async Task Write(string endpoint, string message)
- {
- try
- {
- await semaphore.WaitAsync()
- .ConfigureAwait(false);
- var tableOperation = TableOperation.Insert(new LogEntry(endpoint, message));
- var table = await lazyTable;
- await table.ExecuteAsync(tableOperation)
- .ConfigureAwait(false);
- }
- finally
- {
- semaphore.Release();
- }
- }
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/WorkerRole.cs b/samples/azure/self-host/Core_7/HostWorker/WorkerRole.cs
deleted file mode 100644
index a6184dc92d3..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/WorkerRole.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.WindowsAzure.ServiceRuntime;
-using NServiceBus;
-using NServiceBus.Logging;
-
-public class WorkerRole :
- RoleEntryPoint
-{
- #region AzureSelfHost_StartEndpoint
-
- public override bool OnStart()
- {
- StartEndpoint().GetAwaiter().GetResult();
- return base.OnStart();
- }
-
- static async Task StartEndpoint()
- #endregion
- {
- var configuration = new EndpointConfiguration("SelfHostedEndpoint");
-
- #region AzureSelfHost_CriticalError
-
- configuration.DefineCriticalErrorAction(
- onCriticalError: context =>
- {
- if (Environment.UserInteractive)
- {
- // so that user can see on their screen the problem
- Thread.Sleep(10000);
- }
-
- var message = $"Critical error encountered:\n{context.Error}\nNServiceBus is shutting down.";
- LogManager.GetLogger(typeof(WorkerRole)).Fatal(message);
- Environment.FailFast(message, context.Exception);
- return Task.CompletedTask;
- });
-
- #endregion
-
- #region AzureSelfHost_DisplayName
-
- if (SafeRoleEnvironment.IsAvailable)
- {
- var host = SafeRoleEnvironment.CurrentRoleName;
- var instance = SafeRoleEnvironment.CurrentRoleInstanceId;
- var displayName = $"{host}_{instance}";
- configuration
- .UniquelyIdentifyRunningInstance()
- .UsingNames(instance, host)
- .UsingCustomDisplayName(displayName);
- }
-
- #endregion
-
- #region AzureSelfHost_ConnectionString
-
- var connectionString = RoleEnvironment.GetConfigurationSettingValue("HostWorker.ConnectionString");
- var persistence = configuration.UsePersistence();
- persistence.ConnectionString(connectionString);
- var transport = configuration.UseTransport();
- transport.ConnectionString(connectionString);
-
- #endregion
-
- transport.SerializeMessageWrapperWith();
- transport.DelayedDelivery().DisableTimeoutManager();
- configuration.SendFailedMessagesTo("error");
- configuration.DisableNotUsedFeatures();
- configuration.UseSerialization();
-
- endpoint = await Endpoint.Start(configuration)
- .ConfigureAwait(false);
-
- Trace.TraceInformation("HostWorker has been started");
-
- await endpoint.SendLocal(new MyMessage())
- .ConfigureAwait(false);
-
- Trace.TraceInformation("Message sent out");
- }
-
- public override void OnStop()
- {
- Trace.TraceInformation("HostWorker is stopping");
-
- endpoint.Stop().GetAwaiter().GetResult();
- base.OnStop();
-
- Trace.TraceInformation("HostWorker has stopped");
- }
-
- static IEndpointInstance endpoint;
-}
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/HostWorker/app.config b/samples/azure/self-host/Core_7/HostWorker/app.config
deleted file mode 100644
index ee852a6afc5..00000000000
--- a/samples/azure/self-host/Core_7/HostWorker/app.config
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/self-host/Core_7/msbuild b/samples/azure/self-host/Core_7/msbuild
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/samples/azure/self-host/sample.md b/samples/azure/self-host/sample.md
deleted file mode 100644
index 7f25b72019c..00000000000
--- a/samples/azure/self-host/sample.md
+++ /dev/null
@@ -1,78 +0,0 @@
----
-title: Self-Hosting in Azure Cloud Services
-summary: Using the NServiceBus self-hosting capability to host an endpoint in an Azure instance.
-component: Core
-reviewed: 2019-07-02
-related:
-- nservicebus/hosting/cloud-services-host/shared-hosting
----
-
-## Running in development mode
-
- 1. Start [Azure Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/storage-use-emulator)
- 1. Run the solution
- 1. Inspect Azure Storage Emulator Tables for `SelfHostedEndpointsOutput` table and its content for something like the following:
-
-| PartitionKey | RowKey | Timestamp | Message |
-|:--|:--|:--|:--|
-|MyMessageHandler |2017-09-19 10:19:08 |2017-09-19T08:19:27.691Z |Got MyMessage. |
-
-Results are sorted by Timestamp
-
-
-## Deploying endpoints
-
- 1. Open a PowerShell console at the `self-host\CloudServicesHost_{version}` location. This location should contain a file called `PackageAndDeploy.ps1`.
- 1. Execute the `PackageAndDeploy.ps1` PowerShell script to package and deploy multi-hosted endpoints to local emulator storage.
-
-
-## Running a self-host in emulated Cloud Service
-
- 1. Set `HostCloudService` to be the start-up project by right-clicking the project name in Visual Studio Solution Explorer, and selecting `Set as StartUp Project` option
- 1. Run the solution
- 1. Inspect Azure Storage Emulator tables for `SelfHostedEndpointsOutput` table and its content
-
-NOTE: To inspect multi-host role emulated file system navigate to `C:\Users\%USERNAME%\AppData\Local\dftmp\Resources`
-
-Azure Compute Emulator leaves any processes spawned at run time in memory. These can be killed by locating the `WaWorkerHost.exe` process and killing all child processes named `NServiceBus.Hosting.Azure.HostProcess.exe`. The number of those processes will be the same as the number of endpoints (i.e. one) x the number of times Cloud Service was executed.
-
-Cloud Service emulator can also be stopped with the Compute Emulator UI. The Compute Emulator UI can be accessed via the try icon on the taskbar. Within Compute Emulator UI, under `Service Deployments` tree select a deployment, right-click, and select the `Remove` option. This will cleanly stop Cloud Service without leaving any processes in memory.
-
-
-## Code walk-through
-
-This sample contains five projects:
-
- * HostWorker - Self-host endpoint deployed as worker role.
- * HostCloudService - Azure Cloud Service project to define and execute cloud service.
-
-
-### HostWorker project
-
-HostWorker project uses the self-hosting capability to start an endpoint inside a worker role.
-
-The snippet below illustrates how the `OnStart` method of `RoleEntryPoint` calls in a blocking way into an asynchronous start method.
-
-snippet: AzureSelfHost_StartEndpoint
-
-A critical error action needs to be defined to restart the host when a critical error is raised.
-
-snippet: AzureSelfHost_CriticalError
-
-To uniquely identify the host a custom name and display name must be provided.
-
-snippet: AzureSelfHost_DisplayName
-
-The connection string can be loaded using the `RoleEnvironment` as shown below.
-
-snippet: AzureSelfHost_ConnectionString
-
-### HostCloudService project
-
-The HostCloudService project defines self-host parameters for all environments (`Local` and `Cloud` in this sample)
-
-snippet: AzureSelfHosting_CloudServiceDefinition
-
-Values provided to execute the sample against local Azure Storage emulator
-
-snippet: AzureSelfHosting_CloudServiceConfiguration
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.StartupProjects.txt b/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.StartupProjects.txt
deleted file mode 100644
index 92343b62c9b..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.StartupProjects.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Receiver\Receiver.csproj
-Sender\Sender.csproj
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln b/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln
deleted file mode 100644
index 9cd69b87119..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29728.190
-MinimumVisualStudioVersion = 15.0.26730.12
-Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "HostCloudService", "HostCloudService\HostCloudService.ccproj", "{CD8D25E1-7D63-49DE-A109-4ABF98731C24}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostWorker", "HostWorker\HostWorker.csproj", "{07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sender", "Sender\Sender.csproj", "{CB35AFED-9727-4523-999A-0D58AA5137FE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{07BC8092-EE47-4242-B39D-AB77D02AC67B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Receiver", "Receiver\Receiver.csproj", "{16542897-4807-4486-A392-C778FC616951}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CD8D25E1-7D63-49DE-A109-4ABF98731C24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CD8D25E1-7D63-49DE-A109-4ABF98731C24}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CB35AFED-9727-4523-999A-0D58AA5137FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CB35AFED-9727-4523-999A-0D58AA5137FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {07BC8092-EE47-4242-B39D-AB77D02AC67B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {07BC8092-EE47-4242-B39D-AB77D02AC67B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {16542897-4807-4486-A392-C778FC616951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {16542897-4807-4486-A392-C778FC616951}.Debug|Any CPU.Build.0 = Debug|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln.DotSettings b/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln.DotSettings
deleted file mode 100644
index 7926067e7dc..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/AzureSharedHosting.sln.DotSettings
+++ /dev/null
@@ -1,6 +0,0 @@
-
- ..\..\..\..\..\tools\Shared.DotSettings
- True
- True
- 1
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostCloudService.ccproj b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostCloudService.ccproj
deleted file mode 100644
index 42e948b7450..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostCloudService.ccproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 2.9
- cd8d25e1-7d63-49de-a109-4abf98731c24
- Library
- Properties
- HostCloudService
- HostCloudService
- True
- HostCloudService
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HostWorker
- {07fdac8f-a69d-4a5c-aba1-daec52a649fb}
- True
- Worker
- HostWorker
- True
-
-
-
-
- 14.0
- $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostWorkerContent/diagnostics.wadcfgx b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostWorkerContent/diagnostics.wadcfgx
deleted file mode 100644
index 17c38f28f0e..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/HostWorkerContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/SenderContent/diagnostics.wadcfgx b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/SenderContent/diagnostics.wadcfgx
deleted file mode 100644
index 17c38f28f0e..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/SenderContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Cloud.cscfg b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Cloud.cscfg
deleted file mode 100644
index af3c620e430..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Cloud.cscfg
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Local.cscfg b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Local.cscfg
deleted file mode 100644
index 1fb84b765cd..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceConfiguration.Local.cscfg
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceDefinition.csdef b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceDefinition.csdef
deleted file mode 100644
index 16aebf86d74..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ServiceDefinition.csdef
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx b/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx
deleted file mode 100644
index 6f86bae755b..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostCloudService/ecf/HostWorkerContent/diagnostics.wadcfgx
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- devstoreaccount1
-
-
-
-
- true
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/EndpointConfig.cs b/samples/azure/shared-host/CloudServicesHost_8/HostWorker/EndpointConfig.cs
deleted file mode 100644
index b5b1f609f99..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/EndpointConfig.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using Microsoft.WindowsAzure.ServiceRuntime;
-using NServiceBus;
-
-#pragma warning disable 618
-
-#region AzureSharedHosting_HostConfiguration
-
-public class EndpointConfig :
- IConfigureThisHost
-{
- public void Customize(EndpointConfiguration endpointConfiguration)
- {
- }
-
- public HostingSettings Configure()
- {
- var connectionString = RoleEnvironment.GetConfigurationSettingValue("HostWorker.ConnectionString");
- var autoUpdate = bool.Parse(RoleEnvironment.GetConfigurationSettingValue("HostWorker.AutoUpdate"));
- var updateInterval = int.Parse(RoleEnvironment.GetConfigurationSettingValue("HostWorker.UpdateInterval"));
- var container = RoleEnvironment.GetConfigurationSettingValue("HostWorker.Container");
-
- return new HostingSettings(connectionString)
- {
- AutoUpdate = autoUpdate,
- UpdateInterval = updateInterval,
- Container = container
- };
- }
-}
-
-#endregion
-
-#pragma warning restore 618
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/HostWorker.csproj b/samples/azure/shared-host/CloudServicesHost_8/HostWorker/HostWorker.csproj
deleted file mode 100644
index 5e23ab2f128..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/HostWorker.csproj
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {07FDAC8F-A69D-4A5C-ABA1-DAEC52A649FB}
- Library
- Properties
- HostWorker
- HostWorker
- v4.6.1
- 512
- Worker
-
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/WorkerRole.cs b/samples/azure/shared-host/CloudServicesHost_8/HostWorker/WorkerRole.cs
deleted file mode 100644
index 57e44b1dd36..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/HostWorker/WorkerRole.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Diagnostics;
-using Microsoft.WindowsAzure.ServiceRuntime;
-using NServiceBus;
-
-public class WorkerRole :
- RoleEntryPoint
-{
-#pragma warning disable 618
- NServiceBusRoleEntrypoint nsb = new NServiceBusRoleEntrypoint();
-#pragma warning restore 618
-
- public override bool OnStart()
- {
- nsb.Start();
-
- Trace.TraceInformation("HostWorker has been started");
-
- return base.OnStart();
- }
-
- public override void OnStop()
- {
- Trace.TraceInformation("HostWorker is stopping");
-
- nsb.Stop();
- base.OnStop();
-
- Trace.TraceInformation("HostWorker has stopped");
- }
-}
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/PackageAndDeploy.ps1 b/samples/azure/shared-host/CloudServicesHost_8/PackageAndDeploy.ps1
deleted file mode 100644
index 581c42e6a38..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/PackageAndDeploy.ps1
+++ /dev/null
@@ -1,47 +0,0 @@
-$baseDir = Split-Path (Resolve-Path $MyInvocation.MyCommand.Path)
-
-# Packaging
-
-$zipsDir = $baseDir + "\_zips";
-Write-Host "Packaging endpoints as zip files..."
-
-if ((Test-Path $zipsDir) -eq $true)
-{
- Get-ChildItem -Path $zipsDir -Include *.* -Recurse | foreach { $_.Delete()}
-}
-else
-{
- New-Item $zipsDir -ItemType Directory -Force
-}
-
-[Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem")
-
-$locationTemplate = "$baseDir\{0}\bin\debug"
-$destinationTemplate = "$zipsDir\{0}.zip"
-
-$location = $locationTemplate -f "Sender"
-$destination = $destinationTemplate -f "Sender"
-[System.IO.Compression.ZipFile]::CreateFromDirectory($location, $destination)
-
-$location = $locationTemplate -f "Receiver"
-$destination = $destinationTemplate -f "Receiver"
-[System.IO.Compression.ZipFile]::CreateFromDirectory($location, $destination)
-
-Write-Host "Zips are created at $zipsDir location" -ForegroundColor Cyan
-
-# Deployment
-
-Write-Host "Deploying endpoints..." -ForegroundColor Cyan
-
-$context = New-AzureStorageContext -Local
-$containerName = "endpoints"
-$container = Get-AzureStorageContainer -Name $containerName -Context $context -ErrorAction SilentlyContinue
-if (!$container)
-{
- Write-Host "Creating '$containerName' container for uploaded endpoints" -ForegroundColor Cyan
- New-AzureStorageContainer -Name $containerName -Permission Off -Context $context
-}
-
-ls -path $zipsDir -file -recurse | Set-AzureStorageBlobContent -Container $containerName -Context $context -Force
-
-Write-Host "Endpoints deployed to storage account " $context.StorageAccountName -ForegroundColor Cyan
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Receiver/EndpointConfig.cs b/samples/azure/shared-host/CloudServicesHost_8/Receiver/EndpointConfig.cs
deleted file mode 100644
index 1c6c5accab4..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Receiver/EndpointConfig.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using NServiceBus;
-using NServiceBus.Logging;
-
-#pragma warning disable 618
-
-public class EndpointConfig :
- IConfigureThisEndpoint
-{
- static EndpointConfig()
- {
- var defaultFactory = LogManager.Use();
- defaultFactory.Level(LogLevel.Debug);
- }
-
- public void Customize(EndpointConfiguration endpointConfiguration)
- {
- var persistence = endpointConfiguration.UsePersistence();
- persistence.ConnectionString("UseDevelopmentStorage=true");
- var transport = endpointConfiguration.UseTransport();
- transport.ConnectionString("UseDevelopmentStorage=true");
- transport.SerializeMessageWrapperWith();
- transport.DelayedDelivery().DisableTimeoutManager();
- endpointConfiguration.SendFailedMessagesTo("error");
- endpointConfiguration.DisableNotUsedFeatures();
- endpointConfiguration.UseSerialization();
- }
-}
-
-#pragma warning restore 618
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Receiver/PingHandler.cs b/samples/azure/shared-host/CloudServicesHost_8/Receiver/PingHandler.cs
deleted file mode 100644
index 80982341b4a..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Receiver/PingHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Threading.Tasks;
-using NServiceBus;
-
-#region AzureMultiHost_PingHandler
-
-public class PingHandler :
- IHandleMessages
-{
- public Task Handle(Ping message, IMessageHandlerContext context)
- {
- VerificationLogger.Write("Receiver", "Got Ping and will reply with Pong");
- return context.Reply(new Pong());
- }
-}
-
-#endregion
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Receiver/Receiver.csproj b/samples/azure/shared-host/CloudServicesHost_8/Receiver/Receiver.csproj
deleted file mode 100644
index c1a58428b11..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Receiver/Receiver.csproj
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {16542897-4807-4486-A392-C778FC616951}
- Library
- Properties
- Receiver
- Receiver
- v4.6.1
- 512
-
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Program
- $(TargetDir)NServiceBus.Hosting.Azure.HostProcess.exe
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Sender/EndpointConfig.cs b/samples/azure/shared-host/CloudServicesHost_8/Sender/EndpointConfig.cs
deleted file mode 100644
index 5a8806bd0d1..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Sender/EndpointConfig.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using NServiceBus;
-using NServiceBus.Logging;
-
-#pragma warning disable 618
-
-public class EndpointConfig :
- IConfigureThisEndpoint
-{
- static EndpointConfig()
- {
- var defaultFactory = LogManager.Use();
- defaultFactory.Level(LogLevel.Debug);
- }
-
- public void Customize(EndpointConfiguration endpointConfiguration)
- {
- var persistence = endpointConfiguration.UsePersistence();
- persistence.ConnectionString("UseDevelopmentStorage=true");
-
- #region AzureMultiHost_MessageMapping
-
- var transport = endpointConfiguration.UseTransport();
- var routing = transport.Routing();
- routing.RouteToEndpoint(
- messageType: typeof(Ping),
- destination: "Receiver");
-
- #endregion
-
- transport.ConnectionString("UseDevelopmentStorage=true");
- transport.SerializeMessageWrapperWith();
- transport.DelayedDelivery().DisableTimeoutManager();
- endpointConfiguration.SendFailedMessagesTo("error");
- endpointConfiguration.DisableNotUsedFeatures();
- endpointConfiguration.UseSerialization();
- }
-}
-
-#pragma warning restore 618
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Sender/PongHandler.cs b/samples/azure/shared-host/CloudServicesHost_8/Sender/PongHandler.cs
deleted file mode 100644
index d7beb82769b..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Sender/PongHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Threading.Tasks;
-using NServiceBus;
-
-#region AzureMultiHost_PongHandler
-
-public class PongHandler :
- IHandleMessages
-{
- public Task Handle(Pong message, IMessageHandlerContext context)
- {
- VerificationLogger.Write("Sender", "Got Pong from Receiver");
- return Task.CompletedTask;
- }
-}
-
-#endregion
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Sender/SendPing.cs b/samples/azure/shared-host/CloudServicesHost_8/Sender/SendPing.cs
deleted file mode 100644
index b6c460d2c2a..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Sender/SendPing.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.Threading.Tasks;
-using NServiceBus;
-
-#pragma warning disable 618
-
-#region AzureMultiHost_SendPingCommand
-
-public class SendPing :
- IWantToRunWhenEndpointStartsAndStops
-{
- public Task Start(IMessageSession session)
- {
- VerificationLogger.Write("Sender", "Pinging Receiver");
- return session.Send(new Ping());
- }
-
- public Task Stop(IMessageSession session)
- {
- return Task.CompletedTask;
- }
-}
-
-#endregion
-
-#pragma warning restore 618
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Sender/Sender.csproj b/samples/azure/shared-host/CloudServicesHost_8/Sender/Sender.csproj
deleted file mode 100644
index 3eba6baf371..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Sender/Sender.csproj
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {CB35AFED-9727-4523-999A-0D58AA5137FE}
- Library
- Properties
- Sender
- Sender
- v4.6.1
- 512
-
- true
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Program
- $(TargetDir)NServiceBus.Hosting.Azure.HostProcess.exe
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/LogEntry.cs b/samples/azure/shared-host/CloudServicesHost_8/Shared/LogEntry.cs
deleted file mode 100644
index 545352d51b8..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/LogEntry.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using Microsoft.WindowsAzure.Storage.Table;
-
-class LogEntry :
- TableEntity
-{
- public LogEntry(string endpoint, string message)
- {
- PartitionKey = endpoint;
- RowKey = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- Message = message;
- }
-
- public string Message { get; set; }
-}
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/NServiceBusFeatures.cs b/samples/azure/shared-host/CloudServicesHost_8/Shared/NServiceBusFeatures.cs
deleted file mode 100644
index 05af3eb898a..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/NServiceBusFeatures.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using NServiceBus;
-using NServiceBus.Features;
-
-public static class NServiceBusFeatures
-{
- public static void DisableNotUsedFeatures(this EndpointConfiguration endpointConfiguration)
- {
- endpointConfiguration.DisableFeature();
- var recoverability = endpointConfiguration.Recoverability();
- recoverability.Delayed(
- customizations: settings =>
- {
- settings.NumberOfRetries(0);
- });
- endpointConfiguration.DisableFeature();
- }
-}
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/Ping.cs b/samples/azure/shared-host/CloudServicesHost_8/Shared/Ping.cs
deleted file mode 100644
index 17e302e6bb3..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/Ping.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using NServiceBus;
-
-#region AzureMultiHost_PingMessage
-
-public class Ping :
- ICommand
-{
-}
-
-#endregion
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/Pong.cs b/samples/azure/shared-host/CloudServicesHost_8/Shared/Pong.cs
deleted file mode 100644
index 3fc1e974444..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/Pong.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using NServiceBus;
-
-#region AzureMultiHost_PongMessage
-
-public class Pong :
- IMessage
-{
-}
-
-#endregion
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/Shared.csproj b/samples/azure/shared-host/CloudServicesHost_8/Shared/Shared.csproj
deleted file mode 100644
index 141a4241be5..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/Shared.csproj
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {07BC8092-EE47-4242-B39D-AB77D02AC67B}
- Library
- Properties
- Shared
- Shared
- v4.6.1
- 512
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/VerificationLogger.cs b/samples/azure/shared-host/CloudServicesHost_8/Shared/VerificationLogger.cs
deleted file mode 100644
index c38d0eb0da4..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/VerificationLogger.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Microsoft.WindowsAzure.Storage;
-using Microsoft.WindowsAzure.Storage.Table;
-
-public static class VerificationLogger
-{
- static CloudTable table;
- static object locker = new object();
-
- static VerificationLogger()
- {
- var cloudStorageAccount = CloudStorageAccount.DevelopmentStorageAccount;
- var cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
- table = cloudTableClient.GetTableReference("MultiHostedEndpointsOutput");
- table.CreateIfNotExists();
- }
-
- public static void Write(string endpoint, string message)
- {
- lock (locker)
- {
- var tableOperation = TableOperation.Insert(new LogEntry(endpoint, message));
- table.Execute(tableOperation);
- }
- }
-
-}
\ No newline at end of file
diff --git a/samples/azure/shared-host/CloudServicesHost_8/Shared/app.config b/samples/azure/shared-host/CloudServicesHost_8/Shared/app.config
deleted file mode 100644
index e7efd6e7327..00000000000
--- a/samples/azure/shared-host/CloudServicesHost_8/Shared/app.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/azure/shared-host/CloudServicesHost_8/msbuild b/samples/azure/shared-host/CloudServicesHost_8/msbuild
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/samples/azure/shared-host/sample.md b/samples/azure/shared-host/sample.md
deleted file mode 100644
index 5a81c9d50a9..00000000000
--- a/samples/azure/shared-host/sample.md
+++ /dev/null
@@ -1,103 +0,0 @@
----
-title: Shared Hosting in Azure Cloud Services
-summary: Uses the NServiceBus Hosting Azure HostProcess to achieve shared hosting of multiple NServiceBus endpoints in an Azure instance.
-component: CloudServicesHost
-reviewed: 2021-01-11
-related:
-- nservicebus/hosting/cloud-services-host/shared-hosting
----
-
-
-## Running in development mode
-
- 1. Start [Azure Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/storage-use-emulator)
- 1. Run the solution
- 1. Inspect Azure Storage Emulator `MultiHostedEndpointsOutput` table for content similar to:
-
-| PartitionKey | RowKey | Timestamp | Message |
-|:--|:--|:--|:--|
-|Sender |2015-05-25 14:58:33 |2015-05-25 16:58:33 |Pinging Receiver |
-|Receiver |2015-05-25 14:58:34 |2015-05-25 16:58:34 |Got Ping and will reply with Pong |
-|Sender |2015-05-25 14:58:35 |2015-05-25 16:58:35 |Got Pong from Receiver |
-
-Results sorted by Timestamp
-
-
-## Deploying endpoints
-
- 1. Open PowerShell console at the `shared-host\CloudServicesHost_{version}` location. This location should contain `PackageAndDeploy.ps1`.
- 1. Execute `PackageAndDeploy.ps1` PowerShell script to package and deploy multi-hosted endpoints to local emulator storage
-
-
-## Running multi-host in emulated Cloud Service
-
- 1. Set `HostCloudService` to be the start-up project by right clicking the project name in Visual Studio Solution Explorer, and selecting `Set as StartUp Project` option
- 1. Run the solution
- 1. Inspect Azure Storage Emulator Tables for `MultiHostedEndpointsOutput` table and its content
-
-NOTE: To inspect multi-host role emulated file system navigate to `C:\Users\%USERNAME%\AppData\Local\dftmp\Resources`
-
-Azure Compute Emulator leaves any processes spawned at run time in memory. Kill those once done with emulated Cloud Service execution by locating `WaWorkerHost.exe` process and killing all child processes named `NServiceBus.Hosting.Azure.HostProcess.exe`. Number of those processes will equal the number of endpoints (which in this case equals 2) multiplied by the number of times Cloud Service was executed.
-
-Cloud Service emulator can also be stopped from Compute Emulator UI. Compute Emulator UI can be accessed via try icon on the taskbar. Within Compute Emulator UI, under `Service Deployments` tree select a deployment, right click and select `Remove` option. This will stop Cloud Service without leaving any processes in memory.
-
-
-## Code walk-through
-
-This sample contains five projects:
-
- * Shared - A class library containing shared code including the message definitions.
- * Sender - An NServiceBus endpoint responsible for sending `Ping` command to the `Receiver` endpoint processing.
- * Receiver - An NServiceBus endpoint that receives `Ping` command and responds back to originator with `Pong` message.
- * HostWorker - Multi-host endpoint deployed as worker role.
- * HostCloudService - Azure Cloud Service project to define and execute cloud service.
-
-
-### Sender project
-
-Sender project defines message mapping instructing NServiceBus to send `Ping` commands to the `Receiver` endpoint.
-
-snippet: AzureMultiHost_MessageMapping
-
-When the endpoint is started, a `Ping` command is sent and a log entry is written to Azure Storage Tables (see the Shared project for details on the log generation).
-
-snippet: AzureMultiHost_SendPingCommand
-
-Sender defines a handler for messages of type `Pong` and writes to the log when a message of this type arrives.
-
-snippet: AzureMultiHost_PongHandler
-
-
-### Receiver project
-
-Receiver project has a handler for `Ping` commands and it writes to the log when such a message arrives. It also replies to the originator with the `Pong` message.
-
-snippet: AzureMultiHost_PingHandler
-
-
-### Shared project
-
-Shared project defines all the messages used in the sample
-
-snippet: AzureMultiHost_PingMessage
-snippet: AzureMultiHost_PongMessage
-
-
-### HostWorker project
-
-HostWorker project is the multi-host project. To enable multi-hosting, endpoint is configured as a multi-host
-
-snippet: AzureSharedHosting_HostConfiguration
-
-NOTE: Multi-host project is used only as a host for other endpoints and contains no NServiceBus related logic
-
-
-### HostCloudService project
-
-HostCloudService project defines multi-host parameters for all environment (`Local` and `Cloud` in this sample)
-
-snippet: AzureSharedHosting_CloudServiceDefinition
-
-Values provided to execute sample against local Azure Storage emulator
-
-snippet: AzureSharedHosting_CloudServiceConfiguration
diff --git a/samples/azure/webjob-host/sample.md b/samples/azure/webjob-host/sample.md
index f976e5414fc..81759c8e56d 100644
--- a/samples/azure/webjob-host/sample.md
+++ b/samples/azure/webjob-host/sample.md
@@ -6,7 +6,9 @@ reviewed: 2020-02-26
isLearningPath: true
related:
- samples/dependency-injection/aspnetcore
-
+redirects:
+- samples/azure/self-host
+- samples/azure/shared-host
---
This sample is compatible with Azure WebJobs SDK 3.0.