Repo to describe how to run NServiceBus backends as Azure WebJobs.
The complete use case is described on my blog at: Migrating NServiceBus backends to Azure WebJobs.
However, the changes can be summarized in:
- Transform your Class Library into a Console Application
- Introduce a
Program.cs
file (shown in this example) - Make certain modifications to your
EndpointConfig.cs
(also shown in this example)
There are two files in this repo that deserve attention:
Program.cs
: shows how to intialize the enpoint asynchronously from a console applicationEndpointConfig.cs
: a dummy example on how to initialize a simple NSB endpoint.
Why name the class Program.cs
? Because a WebJob can be essentially a simple console
application. Keeping the standard name for .NET console applications just made
sense.
Deployment is also addressed on the post and can be summarized in:
- Using PowerShell
- Using Post-build events
- Using Nuget packages
- Poor's man deployment 😢
If you're using NuGet and bundling your deployment in a
NuGet package by using Nuspec
files, a simplified version using can be found
at app.nuspec
file.
Thanks and don't forget to visit my blog at blog.hildenco.com
MIT