Deploying azure webjob via git

I have a solution containing a .net mvc website and a website.

I am deploying with git - and so on git push to azure, my site is being updated. Now I just add a console application that will run on schedule. I am trying to decide how to deploy this with a website when I git push , but I'm not sure how to do this.

I know that I can create the website\app_data\jobs\triggered\webjob and copy the files there (say from the post-build event on the webjob), but that would mean that I would need to transfer all these files to the git repository for deployment to pick them up - which would also mean that every time I build, git will offer me to commit them again - pah.

Is there a better way to do this - where can I just push my repo to azure and it will properly host my website and my website?

thanks

+8
azure azure-webjobs kudu
source share
3 answers

Yes, you can do this without explicitly specifying the EXE and the project in the folder explicitly. This Azure Blog blog post documents a workaround for enabling Git or the command line to deploy a web application, including WebJob.

http://azure.microsoft.com/blog/2014/08/18/enabling-command-line-or-continuous-delivery-of-azure-webjobs/

If this does not unlock, send a message and I will help you diagnose any other problems that you have encountered. You can also update the WebJob NuGet publication to the most updated version of NuGet here: https://www.nuget.org/packages/Microsoft.Web.WebJobs.Publish/1.0.2

+4
source share

As of 9/15/2015, this looks as simple as some context menus inside Visual Studio.

If you want your WebJob to automatically deploy each time you deploy your website, in Visual Studio you can right-click on the website and select "Add-> Existing Project as Azure WebJob".

Read more here , in particular the section "Enable automatic deployment of WebJobs with a web project."

+3
source share

I struggled with this, but now it works for me.

It seems like you need to use WebJobs.Publish 1.0.2. 1.0.1 did not work for me. Worked as soon as I updated.

I also tried adding the webjobs.props files, as pointed out here by David Ebbo, but this did not work for 1.0.1, and now they deleted these files and worked under 1.0.2 without them.

Using WebJobs.Publish creates webjob-publish-settings.json (in the webjob project) and webjobs-list.json (in the MVC application), and that would seem to be all you need.

The only thing that does not work is to create a schedule for the scheduled task. Continuous and trigger jobs deploy just fine. There is a thread here where David Ebbo mentions that this is a current limitation.

+1
source share

All Articles