Easily Deploy Your Azure WebJob With a TFS Release Definition


In this blog post, I will explain you how to deploy an Azure WebJob via a release definition in TFS Online.

I will assume that you know what is a WebJob and how to manage it, but also how to use and configure TFS Online. I’m considering that you have the WebJob already deployed and configured to your subscription.

Many blogs are telling that we have to convert our “WebJob Visual Studio solution” to a Web type project, then create a release and embed the WebJob code during the build.

It was too much steps for me so I looked after an easiest solution… J

This solution will work with all WebJobs types. Just for the Continuous type, an App Service restart will be required (this won’t be explained).

  1. Let’s configure the build definition :build
    • Get the Source code
    • Restore the NuGet Package
    • Use the build configuration as follow :
      build detail
    • Configure the copy as follow :
    • Configure the publish artifacts as follow :


  1. Let’s configure the release definition :

For the release definition we’re going to use the FTP protocol to deploy our content to our App Service. You can retrieve the FTP connection’s information of your App Service via the publishing profile. Download and open it with notepad++ for instance. Look for FTP and you will find the server, user and password to connect.


  • Create an environment and add the task FTP Upload
  • In Authentication method, select Enter Credentials
  • In Server , user and password, fill in with the info retrieved from the publishing profile
  • Source Folder, select the …’s button next to the field and navigate to your code folder
  • File Patterns, set ** to take everything
  • In the remote repository, the example is for a scheduled WebJob. If it is your case, type the same as showed (/site/wwwroot/App_Data/jobs/triggered/MyWebJobName), but replace the “MyWebJobName” by the name of your WebJob defined during the creation. If you have any doubt of what is your folder, you can take an FTP tool (like FileZila) and navigate to this folder to see the exact path.
  • In the advanced section, define as showed. Do not check the box clean remote repository, this will erase everything in the destination repository, which contain the schedule of your WebJob too.

Enjoy ! 🙂

This entry was posted in Azure, C# Solutions and tagged , , , , , , , . Bookmark the permalink.

2 Responses to Easily Deploy Your Azure WebJob With a TFS Release Definition

  1. Enrika says:

    Oh my God, I’ve been beating my head against the wall with this for more than 20 hours, now… I’d honestly given up all hope and was Googling how to deploy the webjob from within the release definition for the app service itself, even though that’s absolutely not what we want to do (I mean it’s Sunday night, I was running out of options, and I didn’t want to stroll into work in the morning with, “It simply can’t be done”), and it was only *then* that I found your UNBELIEVABLY helpful post! As far as I can tell, you’re the ONLY goddamn person in the ENTIRE world who has figured this out and bothered to post the solution online, and I’m *incredibly* grateful. If you’re ever in Phoenix, give me a shout and I’ll take you out for a much-deserved drink. Thank you so *very* much. 🙂

    Yours in eternal gratitude,

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s