Today I found myself upgrading applications from .NET Core 1.0 to 2.2. Azure webjobs was a nuget package used in this project.
What is azure webjobs in a nutshell?
WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
Supported file types for scripts or programs
The following file types are supported:
- .cmd, .bat, .exe (using Windows cmd)
- .ps1 (using PowerShell)
- .sh (using Bash)
- .php (using PHP)
- .py (using Python)
- .js (using Node.js)
- .jar (using Java)
Azure webjobs with .net core
Based on my findings I realized that the 2.0 azure webjobs did not work with .NET Core. The 3.0 NuGet package update (non-beta) brought breaking changes. It’s based on the generic host which is similar to the asp.net host. Here’s an example of the new setup. There are quite some breaking changes in the 3.0, for example:
2.0
host.RunAndBlock();
3.0
host.StartAsync();
If you are interested in WebJobs SDK version 2.x, which only supports .NET Framework, see Develop and deploy WebJobs using Visual Studio — Azure App Service.
I found a very good article that points out some of the differences between 2.0 and 3.0
Hopefully this motivates you to upgrade your Webjobs package!