How to download your Azure Web Job

by Matthew Hart on December 01, 2018

Background

If you were unlucky like me you may have lost the source code for your Azure web job. My hard drive crashed while I was working on a web job that would download media for our Umbraco sites from our Azure Storage and copy it into the media folder. I created another web job that would also remove media to free up space on our App Service Plan. You may be thinking why don't you just keep the media in azure storage and get umbraco to fetch the media itself? While that would be great and free up space in our App Service Plan, its better that our developer sites for our clients match their production sites and not have any extra bells or whistles in the codebase.

Solution

I was constantly looking through the Kudu console trying to find where the web jobs were stored. So I did a Google search like any other confused developer would, but didn't find much. After submitting a question on stackoverflow the answer was really simple! 

It is located here: D:\home\site\wwwroot\app_data\jobs I didn't expect it to be living inside the wwwroot folder for the web app but that's where it is. Now I won't have to redo the script and I can apply it to our other clients developer sites and more importantly put it in source control!!

Unsure on how to navigate to this location? 

1. First navigate to the web app that the web job is running in.

On the left side scroll down to App Service Editor (Preview)

2. Then click Go on the next screen

3. Once open you will automatically be in the wwwroot folder. Navigate to: D:\home\site\wwwroot\app_data\jobs. As you can see mine is located in the triggered folder and Azure puts each web job into its own folder. You can then click on the file and copy the code from the editor.