ConnectionStrings / AppSettings Azure

During my actions to understand Azure webjobs I stumbled upon this nice feature.

A Webjob is deployed with an Azure website. With a Webjob there belongs a dashboard for logging and details on processing. After I deployed my Webjob on this Dashboard I saw errors and warnings. Although my Webjob was running according to the status.

 siteconstring1

As the error/warning told, I had to add the Connectionstring to the connectionstrings part on the configure part of an Azure website. That cleared the error/warning.

siteconstring2

First thought was now I have to configure the Connectionstring on two places. Once on the portal and once in the app.config of the Webjob. This is not I would like it. I don’t like a setting configured on two places. But that is not necessary.

In your code you use:
var storageAccount =
       CloudStorageAccount.Parse(
          ConfigurationManager.
              ConnectionStrings[
“AzureWebJobsStorage”].
                  ConnectionString
       );

But the value of the Connectionstrings or App settings are entered on the Configure tab of the Azure Website.

image

And this also works for the App.config of an Azure Webjob.

More information: http://www.asp.net/identity/overview/features-api/best-practices-for-deploying-passwords-and-other-sensitive-data-to-aspnet-and-azure