1

I have webapp in azure and with that webapp i have 3 other webjobs inside that. now Webapp is having some settings in appConfig section in web.config. I don't want to copy and past that settings in my other 3 webjob. so is it possible to read Web.config of webApp from Webjob ?

Mahesh
  • 710
  • 7
  • 26
  • did you have a look at CloudConfigurationManager ? https://www.nuget.org/packages/Microsoft.WindowsAzure.ConfigurationManager/ – Thomas Jan 22 '16 at 09:19
  • ya i know about that but i guess that doesn't solve my problem – Mahesh Jan 22 '16 at 09:23
  • So is it specific to azure web app and webjob ? Look at this post: http://stackoverflow.com/questions/27691636/write-appsettings-in-external-file, it will explain you how to externalize your app settings. – Thomas Jan 22 '16 at 09:27

1 Answers1

5

You can share the settings between your Web App and your WebJobs by storing them in the Web App's app settings (on the Azure portal).

To access these settings you simply use ConfigurationManager.AppSettings or if it's not .NET you can access them through the environment (as environment settings).

Amit Apple
  • 8,894
  • 39
  • 49
  • Getting Application Settings as Environment Settings worked for me. For such please refer [this](https://azure.microsoft.com/en-us/blog/windows-azure-web-sites-how-application-strings-and-connection-strings-work/) Do mind of the Prefixes! :) – hiFI Aug 23 '17 at 08:12