Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 Publish WebJobs Issue

Using the right-click, Publish as Azure WebJob... option in VisualStudio 2015, the job is published however the runMode seems to be ignored.

In my file, I have the following settings, however the job is continually set to an On Demand job in the portal after publishing:

{
  "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
  "webJobName": "MyJob",
  "startTime": "2015-07-21T00:30:00-08:00",
  "endTime": null,
  "jobRecurrenceFrequency": "Day",
  "interval": 1,
  "runMode": "Scheduled"
}

Using Visual Studio 2015 with the Azure SDK for .NET 2.7

Here is the Error in the output windows after publishing Error : An error occurred while creating the WebJob schedule: Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.ActiveDirectoryAuthenticationException' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

like image 861
Pat Avatar asked Jul 23 '15 14:07

Pat


People also ask

How do you deploy Azure WebJobs using Visual Studio?

Deploy to Azure App ServiceIn Solution Explorer, right-click the project and select Publish. In the Publish dialog box, select Azure for Target, and then select Next. Select Azure WebJobs for Specific target, and then select Next. Above App Service instances select the plus (+) button to Create a new Azure WebJob.

What is the difference between Azure functions and WebJobs?

Summary. Azure Functions offers more developer productivity than Azure App Service WebJobs does. It also offers more options for programming languages, development environments, Azure service integration, and pricing. For most scenarios, it's the best choice.

Which of the following is not true about WebJobs?

Explanation : A. Incorrect: WebJobs can be triggered by both queue messages and blobs.


2 Answers

Based off of the error, the issue is that you must be logged into Cloud Explorer within Visual Studio for the job to be scheduled properly.

The job will still publish if you are not logged in, however it will only be available OnDemand.

like image 83
Pat Avatar answered Sep 18 '22 08:09

Pat


On my case even though I'm already logged into Cloud Explorer I still get the same error.

I have the latest Azure SDK for .NET (VS 2015) installed as of writing. I had to update my NuGet package Microsoft.Web.WebJobs.Publish from version 1.0.2 to the latest version which is 1.0.10. NuGet Package Upgrade

Then finally the web job was published successfully!

like image 30
Sarah Avatar answered Sep 21 '22 08:09

Sarah