27

I created a scheduled Azure WebJob by right clicking on my WebApp project and adding a New Azure web project. I set the the AzureWebJobsDashboard and AzureWebJobsStorage connection strings in the App.config of the WebJob project. I left the default code in the .cs files alone for now. Next, I published from Visual Studio (2013 Update 4 by the way) to an Azure website. It created the WebJob and I can run it from the Azure Management site or Visual Studio and it is successful. I can see the output logs where I expect them to be. However, the Azure WebJob Details page shows the following warnings/errors:

Make sure that you are setting a connection string named AzureWebJobsDashboard in your Microsoft Azure Website configuration by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

The configuration is not properly set for the Microsoft Azure WebJobs Dashboard. In your Microsoft Azure Website configuration you must set a connection string named AzureWebJobsDashboard by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

It also provides a link that was to http://azure.microsoft.com/blog/2013/07/17/windows-azure-web-sites-how-application-strings-and-connection-strings-work/ which doesn't explain why I am getting the error message.

Now, to get this warning/error to go away, I go add the same AzureWebJobsDashboard connection string in the configure page in the Azure Management site.

So, I'm trying to figure out if I did something wrong or if this is just a kink in the WebJobs that Microsoft hasn't fixed yet. I would really like to be able to have this in the App.config rather than have to remember to set it up in each website we spawn up for different environments.

Thank you very much for your time and help.

Tyler Pohl
  • 595
  • 1
  • 6
  • 10
  • 1
    For more information on how to properly set these values see http://stackoverflow.com/questions/22767176/error-in-azure-webjobs/36269516#36269516 – Nicholas Petersen Mar 28 '16 at 19:27

2 Answers2

38

The dashboard doesn't have access to your web job's app.config file and even if it did, you might have multiple webjobs so it wouldn't know which connection string to pick. That is why you need to set the connection string in the portal.

However, you don't have to set it in app.config for the web job if you set them in the portal. The WebJobs SDK knows how to read them from there.

Nicholas Petersen
  • 9,104
  • 7
  • 59
  • 69
Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • 1
    "However, you don't have to set it in app.config for the web job if you set them in the portal." - Thanks for this information, but can you please indicate where we can find this setting in the portal? Under the web app the job is associated with? I see no such options? – Nicholas Petersen May 07 '15 at 22:32
  • Are you using the new or the old portal? – Victor Hurdugaci May 07 '15 at 23:53
  • 27
    Thanks Victor, but I *finally* figured it out. Very frustrating though. For others: Old Portal: Your website -> Configure tab -> under 'connection strings', enter two new values: a) dropdown type CUSTOM, for NAME do NOT enter the name of your storage account! rather Name is: 'AzureWebJobsDashboard' or for the other (enter two entries): 'AzureWebJobsStorage'. Then for the value, enter the full storage account string: 'DefaultEndpointsProtocol=https;AccountName=YourNAME;AccountKey=YourKEY'. New Portal: Your Web App -> All Settings -> Application Settings -> Connection strings, then dido. – Nicholas Petersen May 08 '15 at 00:19
  • 1
    Just wondering - can this not be done inside the web app config? – Hiral Desai Nov 02 '15 at 05:20
  • 4
    Azure is moving so fast all the step by steps are outdated by the time they show up on google. I would also like to know why my connection strings seem to be ignored from the app config and why there doesn't seem to be ANY place to set them from the current azure portal (Dec/2015). Lame sauce. – TheDev6 Dec 03 '15 at 03:14
  • What connection strings do you set (their name)? – Victor Hurdugaci Dec 03 '15 at 06:52
  • 1
    @VictorHurdugaci - Thanks for answering and reading! The same two connection strings this thread is talking about. AzureWebJobsDashboard and AzureWebJobsStorage. Please let us know.... True or False -> Webjobs completely IGNORE app.config Connection Strings? True or False -> When you set the connection strings in the portal it applies to ALL webjobs and the Website? thx :) – TheDev6 Dec 03 '15 at 20:26
-1

I had to manually add authorization headers: Azure Portal Schedular UI config

For get the value anfter "Basic " I used this code:

var byteArray = Encoding.ASCII.GetBytes("<user>:<password>");
var base64 = Convert.ToBase64String(byteArray);

Ithink is a Azure Scheduler UI bug

Sebastián Rojas
  • 2,776
  • 1
  • 25
  • 34