A Journey to Azure WebJob Deployment

Recently I inherited some poorly written WebJobs that I needed to create an automated deploy for a client to their various environments (DEV, QAE, and PRD).  To start the WebJobs were missing the publish package required to publish them to Azure, which is added either by the package manager (seen bleow) or the Publishing via Visual Studio (using 2017) Publish.

You can add the publishing package from NuGet by running the following command in Package Manager console:

Once that was completed, we need to head over the Visual Studio Team Services (VSTS) to create a build and release for these WebJobs.  The tests were disabled as there were not any in the project and planned to add them in the future.

You only need to do a few modifications to canned build template; however, I did add some build arguments as follows:

One of these arguments changes the deployment path to “Webjob Deploy” and in the Publish Build Artifacts task I change the Path to Publish to the following:

Once I ran the build my artifacts looked like:

Once this is complete we can head over to my build the release for the WebJob code.  We start by linking the artifacts and create an environment, I general start with one to get it working and tested then clone it and change the variables for that environment.

Part of the release was that I needed to create the Azure Resource Group and deploying all the components then linking my deployment artifacts to my these resources (App Service and App Service Plan).  I plan to add a blog post on DSC (Desired State Configuration) scripts and ARM (Azure Resource Manager) templates, so more to come.

Hope this journey helps!