This repository containes some examples of different approaches to run .NET Core apps as Worker Roles on Azure Cloud Services. This repository focuses on Worker Roles. For Web Roles please refer to this this article by Oren Novotny or to the PoC available here
This is the simplest approach as id does not require any hack with the project files. With this approach, you place your worker role logic in a .NET Standard library and you reference it from the classic .NET Framework based worker role project. SEE EXAMPLE HERE
This approach is based on a Self Contained Deployment (SCD) of a .NET Core console application. The csdef file in the cloud service project points directly to the executable of the .NET Core app as role entrypoint. In order to get the .NET Core app deployed, we need to hack a dummy WorkerRole project so that it will trigger dotnet publish against the .NET Core project and include its output. The benefit of this approach is performance as the .NET Core will work on the native .NET Core runtime. Using SCD means you do not need to add a startup task to install the .NET Core runtime on the VMs. SEE EXAMPLE HERE
This is similar to Approach 2 but using the default .NET Core deployment model (Framework Dependent Deployment or FDD). Since the .NET Core runtime is not installed by default on Cloud Services VMs, we need to add some hacks to download and install it at role startup.
In this approach, the classic .NET Framework based worker role executes the .NET Core app executable via Process.Start(). As in approach 2, the .NET Core will work on the native .NET Core runtime. Using SCD means you do not need to add a startup task to install the .NET Core runtime on the VMs.
Same as approach 4 but using FDD. Since the .NET Core runtime is not installed by default on Cloud Services VMs, we need to add some hacks to download and install it at role startup.