问题
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