33
votes

I an trying to publish my website along with few WebJobs but after the website and the jobs are created on the Azure Website, I see an error on the VS.NET 2013 that says:

Error   948 An error occurred while creating the WebJob schedule: No website could be found which matches the WebSiteName [mysitename] and WebSiteUrl [http://mysitename.azurewebsites.net] supplied

my website has 2 WebJobs, 1 that runs continuously and it's created and running, but the one that needs to be triggered on a schedule is having this problem.

Any ideas as to what may be wrong here?

Edit 1

Just wanted to add that the Scheduled Job is getting created as "On Demand"

here is the settings for publishing I am using :

{
  "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
  "webJobName": "ArchiveShipments",
  "startTime": "2015-01-11T00:00:00+05:30",
  "endTime": null,
  "jobRecurrenceFrequency": "Day",
  "interval": 1,
  "runMode": "Scheduled"
}

BTW after i applied AzureSDK. 2.5 I don't see any error on publishing, but the scheduled WebJob is not getting created.

10
i have same problem in my windows azure, did you solve it ?Dot Freelancer
@dotfreelancer - I migrated to SDK 2.5 and the error stopped. and though the job says on demand, but when the trigger passes, it gets converted to scheduled. I think!! I was also playing with creating a schedule manually, not sure which of it actually fixed that partKiran
I have updated my VS 2013 to get new template called "WebJob project" => past my files => then right click on solution => publish as webjob to windows azure.. it works for me!Dot Freelancer
For me, an update of the package Microsoft.Web.WebJobs.Publish helped.Marcus

10 Answers

51
votes

For me this happened when I switched from deploying to one Azure account to another account. In Visual Studio, open/expand the Server Explorer side-window, right click on Azure, select "Connect to Microsoft Azure Subscription...". You'll be asked to logout and login with new credentials. enter image description here

10
votes

If you get this error when publishing from PowerShell, it probably means you are not logged into to your azure subscription or logged into the wrong subscription. If the browser is not prompting for your credentials, it's probably using the wrong subscription. If does not ask for login, clear the cookies and try again.

2
votes

I had this problem when trying to publish my webjob to a deployment slot.

The webjob got published, but the website was not found when trying to hook up the schedule.

I was able to go around this by doing 1 manual publish through the portal, and setting the schedule there. After that i could just publish from VS, and the schedule would remain untouched.

1
votes

I have spent all day on this. The solution for me was to do a manual deployment of the web job via uploading a ZIP and scheduling it as desired. Then, in VS, I did Add Existing Project as Web Job and publishing the Web Site updates the scheduled Web Job as expected.

1
votes

After recent updates, something changed. I was unable to publish to any of my subscriptions where I had a scheduled job. After much digging around, the solution is as follows: - Right click solution and Manage NuGet Packages for Solution - Change all Web Publish modules down to version 1.0.3

Publish. Problem solved.

1
votes

Tried everything here and still had the same issue but I managed to resolve by doing the following:

I have a package called Microsoft.Web.WebJobs.Publish installed which was running an old version (1.0.3). I updated to the latest, currently 1.10.12, and then the app and webjob/schedule published first time.

1
votes

I ran into this again in VS2017, and the root cause was the deprecation of the VS Azure Scheduler integration feature. Per David Ebbo's recommendation in the linked thread, I converted my webjobs to use the CRON scheduling feature and publish now works as expected. Note that the Always On setting must be enabled on the app.

Some more debugging options if you're encountering this:

  • Make sure the correct publish profile (pubxml) file is being used. I had several publish profiles files for the same webjob and tried publishing with the wrong one by mistake.

  • I suggest trying first to publish the webjobs separately, one by one (rather than publish them all alongside the website).

  • If you can't get a webjob to publish, delete its Properties\PublishProfiles folder and try to publish again - you'll be greeted with a VS wizard that should get you sorted (it will recreate the pubxml files correctly).

0
votes

Try updating to Version 2.9 of the Azure SDK, which fixes a related issue:

Repaired issue related to Scheduled WebJobs in which the authentication information was failing to be passed to the Scheduler provisioning process

(https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx)

EDIT:

I ultimately gave up using this scheduler, and switched to the Kudu Scheduler (Internal WebJob Scheduler). See: https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

It is actually easier to set up. All you need to do is add a settings.json file to the webjob with the following contents: {"schedule": "the schedule as a cron expression"}

The pros and cons of using the using the Azure Scheduler vs the Kudu Scheduler are discussed here: http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.Vz4sk5ErJaQ

An important limitation not mentioned in that blog post is that creating a schedule more frequent than hourly is not supported on the free tier of the scheduler (which you are probably using if you haven't intentionally changed it, as it is separate from the app service tier). This is what finally drove me to the Kudu scheduler, as I needed to schedule my job to run every 15 minutes

0
votes

Updating the nuget package to the latest update, in my case 1.10.12, did the trick.

HOWEVER visual studio did not manage to remove the previous package. To do this I had to restart windows, and then before opening up visual studio, deleting the folder containing the old version of webjobs.publish.

This did the trick for me!

0
votes

I managed to rid this error by removing an old reference in my web csproj file

<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.targets')" />

I had already upgraded to the newer package Microsoft.Web.WebJobs.Publish.2.0.0 which was also referenced.