Ultimate Guide to Deploying Azure App Service WebJobs Using Azure DevOps
I recently embarked on a mission to setup an Azure App Service WebJobs as part of a large system migration from on-prem to Azure. The WebJobs are intended to replace several on-prem background jobs. The requirement was to have the WebJobs be deployed as part of a CI/CD pipeline. While this topic has been discussed elsewhere online, I wanted to provide the ultimate guide here as the devil lies in the details.
Although the focus in this post is on deploying the WebJob with Azure DevOps, you can easily port the solution to other ALM tools like GitHub or other tools of your choice.
As a starter I highly recommend that you give this link a look as it guides you through the initial creation of a WebJob. The main thing to pay attention to in the aforementioned post is the fact that you should start with a .Net Core console application and then add the WebJobs SDK to it. Do not utilize the WebJobs template included in Visual Studio as that one would create a WebJob targeting .Net 4.x. In our case we would like to target the latest .Net 6.x framework. Another thing to keep in mind is that when you try to deploy the console application to an Azure app service it will deploy it as a WebJob. This is a detail that escapes a lot of newcomers to WebJobs as people tend to think about Azure app services within the context of deploying web applications.
Note: You can use the dotnet CLI as well to create a .Net 6 console application. So, you can use your…