33

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.

BrutalDev
  • 6,181
  • 6
  • 58
  • 72
Kiran
  • 2,997
  • 6
  • 31
  • 62
  • 1
    i have same problem in my windows azure, did you solve it ? – Dot Freelancer Feb 06 '15 at 18:47
  • @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 part – Kiran Feb 14 '15 at 05:14
  • 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 Feb 14 '15 at 11:05
  • For me, an update of the package `Microsoft.Web.WebJobs.Publish` helped. – Marcus Nov 25 '18 at 18:39

10 Answers10

51

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

Clay Lenhart
  • 1,597
  • 15
  • 17
  • 3
    +1 for the Server Explorer window screenshot. Had a similar problem, but mine said 0 subscriptions and had a yellow triangle in the Azure icon. Reconnected and it worked. – gligoran Oct 20 '15 at 08:27
  • 1
    I'm logged in and can view the objects in my Azure, however I'm still getting this error. – Shimmy Weitzhandler Dec 07 '15 at 08:20
  • 1
    Fixed for me. In Cloud Explorer I was connected to the correct subscription, but not in Server Explorer. Connecting Server Explorer to the correct subscription fixed the issue. Thanks. – Ricky S Jan 07 '16 at 13:57
  • This appeared to be the case for me because I turned on 'two factor auth' last week... – waffles Feb 23 '16 at 02:55
  • Ha! This just bit me again, and I see the comment I left 2 weeks ago. Sigh. Thank god for search engines... – waffles Mar 06 '16 at 01:57
10

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.

RickAndMSFT
  • 20,912
  • 8
  • 60
  • 78
  • Turns out this can also happen from Visual Studio (2013 update 4) if you're connected to the server explorer with one account and try to publish to the other. It's a bit strange though as the WebSite publish worked. – Ohad Schneider Jun 13 '15 at 15:30
  • ...or if Server Explorer isn't connected to *any* account (even though it had prompted to log in, and the check connection was successful) – Rowland Shaw Sep 13 '16 at 16:25
2

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.

Kevin
  • 1,516
  • 1
  • 16
  • 31
1

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.

Andrew Lundgren
  • 1,134
  • 1
  • 12
  • 18
1

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.

Sentinel
  • 3,582
  • 1
  • 30
  • 44
1

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.

lee_mcmullen
  • 2,801
  • 32
  • 39
1

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).

Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
0

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

Loren Paulsen
  • 8,960
  • 1
  • 28
  • 38
0

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

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.

ejanstad
  • 1
  • 1