0

Is there a way to override resolution of values from connectionStrings or appSettings sections at run-time? Can't find any appropriate methods in ConfigurationManager class to do that.

The issue I've got is a Nuget package which relies on ConfigurationManager but my application has custom settings storage (I'm talking to you Azure WebJobs SDK where INameResolver doesn't work with ServiceBusAccountAttribute). So the solution (if any) needs to be Azure friendly.

UserControl
  • 14,766
  • 20
  • 100
  • 187

2 Answers2

1

For bindings with Azure Functions / WebJobs, INameResolver is the way to do this. ServiceBus should be going through that. I filed https://github.com/Azure/azure-webjobs-sdk/issues/1347 to track fixing this. Please follow that issue for updates.

Mike S
  • 3,058
  • 1
  • 22
  • 12
  • Thank you! I believe they fixed that in one of the later 2.x or 3.x betas but I have to stick to the stable which is 2.0. – UserControl Sep 20 '17 at 08:17
0

Is there a way to override resolution of values from connectionStrings or appSettings sections at run-time?

If you'd like to override the existing settings that you set in App.config or Web.config at runtime, you can try to specify App settings with same key under Application Strings on Azure portal.

For detailed information about Application settings, please refer to this article.

App settings

This section contains name/value pairs that you web app will load on start up.

  • For .NET apps, these settings are injected into your .NET configuration AppSettings at runtime, overriding existing settings.
Community
  • 1
  • 1
Fei Han
  • 26,415
  • 1
  • 30
  • 41
  • I need to look into my custom storage first by the key. – UserControl Sep 19 '17 at 08:50
  • [Microsoft.WindowsAzure.ConfigurationManager](https://www.nuget.org/packages/Microsoft.WindowsAzure.ConfigurationManager/) can help us access configuration settings and it is Azure friendly. But it does not provide methods to update configuration settings. – Fei Han Sep 19 '17 at 09:29