Reputation: 7149
I have a bunch of web jobs running as part of an App Service deployment in Microsoft Azure. The jobs are all .NET 4.6-based C# console applications.
One of the jobs depends on the scheduler. I have this webjob-publish-settings.json
file:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "WebJobsRecurring",
"startTime": "2016-02-02T01:00:00+01:00",
"endTime": null,
"jobRecurrenceFrequency": "Day",
"interval": 1,
"runMode": "Scheduled"
}
When I publish the web application associated with this web job I can see in the output window that the schedule was created:
9>Publish Succeeded.
9>Creating the scheduler job
9>Job schedule created
The web job also appears in the portal and the Kudu site, but it never runs. It did run a few times when I first published it, but since the website has been updated a few times it just fails to run automatically. When I manually trigger it from the portal, it runs and completes without errors.
Update Feb. 19: Error in scheduler log
I checked the scheduler log as per @miracledev's suggestion and I found this error:
Http Action - Response from host 'domain.scm.azurewebsites.net': 'Unauthorized'
Response Headers: Date: Fri, 19 Feb 2016 00:02:03 GMT
Server: Microsoft-IIS/8.0
WWW-Authenticate: Basic realm="site"
Body: -- snip --
What might be causing this error?
Upvotes: 3
Views: 1939
Reputation: 7149
(Thanks to @miracledev for pointing me in the right direction.)
It seems that the job does not get created with the proper authentication settings, probably because more developers can publish and they probably have a different publishing profile.
For now I have solved this issue by changing the WebJob from Scheduled
to OnDemand
(in the webjob-publish-settings.json
file).
Following the steps on David Ebbo's blog I have manually hooked up the scheduler. Note that this does not work from the new portal at the time of writing as it does not appear to accept the URL with username and password in it. It does, however, work from the old management portal (at manage.windowsazure.com.
Now the WebJob is triggered successfully again.
Upvotes: 2