0
votes

I have WebJobs running under my Azure Web App. For Web App you can set that the Web App will use remote connection strings (that you setup on Azure portal).

Is it possible to do the same for WebJobs?

So they would be looking for remote connection string instead of using a connections string from (for example) "app.config".

3
Can you provide an example?Rog

3 Answers

0
votes

Could you add the connection string as Web Config value that can be accessed by either the site or webjob?

0
votes

Further more details you could refer to this blog:Configuring Azure Web Jobs.

The main steps are as follows:

  1. Install CloudConfigurationManager package Microsoft.WindowsAzure.ConfigurationManager
  2. Set your connection strings to the app setting.
  3. Retrieve connection string using the CloudConfigurationManager:

    var myConnectionString = CloudConfigurationManager.GetSetting("MyConnectionString");

0
votes

I found out that a connection string setup on Azure Portal overwrites connection string with the same name in .config files. Which means that no additional setup is required.

Azure Portal Connection string takes priority over local *.config connection string.

I successfully tested this.