7

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?

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90

3 Answers3

16

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.

Arek
  • 171
  • 3
  • 1
    +1 Thank you, I have read that article several times and never actually read that section! Changing the jobRecurrenceFrequency in webjob-publish-settings.json to "Hour" worked for me! – How 'bout a Fresca Sep 18 '15 at 15:55
  • I have a P1 (Premium) tier, but it did not allow to publish with 30 minutes either. Seems strange they have that option, but don't allow to publish it with weird errors... – Ilya Chernomordik Oct 02 '15 at 09:59
  • If you convert a Scheduler Job Collection from Free to Basic or Premium, also remember to change the "Max Recurrence" in the Quotas section. The default Max Recurrence of Free Scheduler Job Collections is 1 Hour and this does not get updated if you convert your free job collection to basic or premium. – Vardhaman Deshpande Nov 22 '16 at 17:20
5

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.

Chris Anderson
  • 8,305
  • 2
  • 29
  • 37
  • 1
    See also http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/ for more info on this mechanism. – David Ebbo Aug 13 '15 at 18:36
  • Kudu may not be a great fit for me since we have an on premise TFS installation that we will be deploying from. I realize I didn't include that in the question. – Ryan Gates Aug 13 '15 at 20:03
  • Kudu, aside from being a deployment engine for things like git and hg which you won't need if you'll be deploying from TFS, is also the engine that runs WebJobs. If you have a WebJob today, Kudu is what's running it, so you can use the kudu scheduler as Chris explained. – ahmelsayed Aug 15 '15 at 00:57
  • Exactly, so it's just a setting in your WebJob settings file. Nothing extra on your part. :) – Chris Anderson Aug 15 '15 at 01:24
  • 1
    Please note the Standard in "You need to be using a Standard WebApp" - it will not work under a Basic plan, as David Ebbo explains here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/77030ee5-65a2-4c96-b12d-f0a4f98415f4/webjob-for-the-webapp-with-basic-tier?forum=windowsazurewebsitespreview – Frank van Eykelen Sep 17 '15 at 11:27
  • 1
    Important change: the cron approach is now supported in both Basic and Standard. – David Ebbo Jun 22 '16 at 04:26
1

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.

Jonathan
  • 1,725
  • 3
  • 19
  • 45
  • I have been able to create a scheduled job manually through the portal, but the manual approach makes continuous integration impossible. – Ryan Gates Aug 13 '15 at 16:17