How to publish manually created WebJobs to Azure

依然范特西╮ 提交于 2019-12-10 15:49:01

问题


I created a WebJobs app targeting .NET Core following this article: http://matt-roberts.me/azure-webjobs-in-net-core-2-with-di-and-configuration/

I had to do this manually because currently Visual Studio does not provide a way to create a WebJobs app in .NET Core but I can create a console app targeting .NET Core in Visual Studio 2017.

Now, I want to publish my WebJobs console app to Azure but I'm NOT getting the option to Publish as Azure WebJob which Visual Studio typically gives -- see below:

Instead, I'm just getting "Publish" option and not sure if this will work as intended.

How do I publish my manually created WebJobs console app to Azure as a WebJob?


回答1:


You can always publish WebJobs manually. There are several ways:

  • Directly copy the relevant files into d:\home\site\wwwroot\app_data\jobs\continuous\{job name} (e.g. using Kudu Console)
  • Zip up all the files and upload it as a continuous WebJob using the Azure Portal

Also, for the WebJobs engine to know how to run your Core app, you will need to include a run.cmd file that runs it (place that file in the same folder). e.g. it should contain something like dotnet YouWebJobAssembly.dll, or whatever command line you want to use to start it.



来源:https://stackoverflow.com/questions/48037011/how-to-publish-manually-created-webjobs-to-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!