3
votes

We have a webapp deployed with a production slot and a development slot, for both we've created several webjobs (both continuous and scheduled) and we want to deploy them manually (without being linked to the webapp deploy) so the process we follow for deployment is:

1 -> Deploy WebApp

2 -> For each WebJob: Right Click on the project + Deploy as Azure WebJob + Select proper slot + Publish

We are able to publish for the production slot without any problems, but when it comes to the development slot the following error shows up over and over again:

C:[...]\packages\Microsoft.Web.WebJobs.Publish.1.0.6\tools\webjobs.console.targets(110,5): Error : An error occurred while creating the WebJob schedule: No website could be found which matches the WebSiteName [slot__test] and WebSiteUrl [http://slot-test.azurewebsites.net] supplied

As additional info, we are using Visual Studio Pro 2013 Update 5 and Azure SDK 2.7

Edit: This error is still happening with version 1.0.10

3

3 Answers

6
votes

Found the solution, after downgrading Webjobs.Publish nuget package from 1.0.6 to 1.0.3 everything worked smoothly. MS should be more careful when publishing packages that are not matching the current tooling as it's not the first time we encounter issues like this.

6
votes

This sounds like the same issue: An error occurred while creating the WebJob schedule

For me, I connected to the target subscription in the Server Explorer window. It sounds like this should be unrelated to publishing, but it works.

0
votes

Look at this blog post: http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/

It'll give you another option for deploying a scheduled webjob, all you need is the settings.job file per scheduled webjob with the schedule described using a cron expression.

Like this: {"schedule": "the schedule as a cron expression"}

Then you can delpoy the webjob as "Run on-Demand" (confusing, I know).

To see the status of the webjob go to: https://{sitename}.scm.azurewebsites.net/api/webjobs

For the slot go to: https://{sitename}-{slotname}.scm.azurewebsites.net/api/webjobs

Note the schedule in this scenario is sticky to thesite, opposed to with the Azure scheduler where it is sticky to theslot, this means when you swap the slots, the schedule is swapped with the site so the schedule move from staging to production for example. More about slot stickyness can be found here