Error Creating Webjob schedule

眉间皱痕 提交于 2020-01-21 04:43:06

问题


I have the source code hosted in a TFS 2012 on premise installation. When I try to publish my Azure WebJob to Azure from Visual Studio 2015, I get the following error.

Error : An error occurred while creating the WebJob schedule: Response status code does not indicate success: 409 (Conflict).

The WebJob does get created under the web application, but it is set to On Demand rather than scheduled.

When I open Fiddler to try to troubleshoot this issue, I get the following error.

Error ERROR_CONNECTION_TERMINATED: Web deployment task failed. (Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.)

How can I publish my scheduled WebJob to Azure? Or at least get more specific errors?


回答1:


I had the same problem and it turned out that publish process failed because I set it to recur every 10 minutes while the app was meant to run in free tier. As MS describes here:

https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-deploy-webjobs/

one can deploy with all frequencies other than those defined in minutes.




回答2:


If VS tooling isn't working and you don't want to manually set up the Scheduler, you can try using the built in Scheduler that Kudu (the Web Apps Management framework) provides - https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

To schedule a triggered WebJob you need to add a schedule property to the settings.job file. The value of the schedule is cron expression that has 6 fields to represent the schedule: {second} {minute} {hour} {day} {month} {day of the week}.

You need to be using a Standard WebApp with "Always On" turned on for this to work.

So you just add the following to a settings file if you want to run every 5 minutes.

{
  "schedule": "* */1 * * * *"
}

Sorry for the tooling issues, it's something I'm trying to help resolve.




回答3:


I have had issues several times with the Web Job deployment and had to manually deploy it through the azure portal. It is kind of annoying but much more reliable.



来源:https://stackoverflow.com/questions/31991519/error-creating-webjob-schedule

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