问题描述
根据本文,我创建了一个针对.NET Core的WebJobs应用: http://matt-roberts.me/azure-webjobs-in-net-core-2-with-di-and-configuration/
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/
我必须手动执行此操作,因为当前Visual Studio无法提供在.NET Core
中创建WebJobs
应用程序的方法,但是我可以在Visual Studio 2017中创建针对.NET Core
的控制台应用程序.
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.
现在,我想将我的WebJobs
控制台应用程序发布到Azure,但是我没有获得Visual Studio通常提供的Publish as Azure WebJob
选项-参见下文:
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.
如何将手动创建的WebJobs
控制台应用程序作为WebJob
发布到Azure?
How do I publish my manually created WebJobs
console app to Azure as a WebJob
?
推荐答案
您始终可以手动发布WebJob.有几种方法:
You can always publish WebJobs manually. There are several ways:
- 直接将相关文件复制到
d:\home\site\wwwroot\app_data\jobs\continuous\{job name}
中(例如使用Kudu Console) - 压缩所有文件并使用Azure门户将其作为连续的WebJob上传
- 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
此外,为了使WebJobs引擎知道如何运行Core应用程序,您将需要包含一个运行它的run.cmd
文件(将该文件放置在同一文件夹中).例如它应该包含类似dotnet YouWebJobAssembly.dll
之类的内容,或者您想用来启动它的任何命令行.
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.
这篇关于如何将手动创建的WebJob发布到Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!