Azure WebJobs Deployment with Continuous Integrati

2019-03-09 11:13发布

问题:

Friends,

I am trying to setup Continuous Integration with Azure WebJobs. I have a Web and a WebJobs project in the solution. I have continuous integration and deployment already setup for the web app in Visual Studio Online (*.visualstudio.com). I also connected the WebJobs and the Web app using the Visual Studio ASP.Net extensions - Right click the WebSite project in VS 2013 > Add > Existing Azure WebJob project. It created webjobs-list.json file in the website project.

I was expecting that when the Web app deployment happens to Azure Website after the Visual Studio Online build, it will deploy the WebJobs too. But it is not doing so.

How do we automate the WebJobs deployment after Visual Studio Online build in visualstudio.com?

回答1:

The WTE team is aware of the TFS publishing issues. I've been personally working on developing a workaround with which I'm comfortable but haven't finalized it yet. My team is working on an improvement to the WebJobs publishing experience from VSO. This item is absolutely on our agenda to repair, and will be included in the next VS update. In the meantime I'm trying to come up with a workaround for the time being; once that workaround is prescriptive enough to post, I'll write a post summarizing the process on our team blog.



回答2:

This looks like the way to do it with VSTS

https://blogs.msdn.microsoft.com/tfssetup/2016/05/18/deploying-and-schedule-azure-webjobs-from-vsts-to-azure-web-app-with-bonus-cron-scheduling/

Basically,

  1. Use VS to link your web job to a web app.
  2. Create a new Buildtask that uploads the WebJob.zip file.
  3. Profit.