Azure App Configuration

Prasanna

New member
Joined
May 12, 2023
Messages
3
Programming Experience
10+
Hi,

I'm building a new worker service, in that i want to use my application settings from both local settings and Azure App Configuration.
So i have two questions to clarify before i'm going to implement the Azure App configuration.

1) Can i keep the same keys in both places like my local app settings as well as Azure App configuration?
2) Is it possible to override my local app settings value from azure app configuration? (For instance if i'm not giving any key values in Azure app configuration then it should pick the value from my Local app settings)

Your answers are really appreciated and it's helpful for my solution.
 
Can i keep the same keys in both places like my local app settings as well as Azure App configuration
Keys to what? If both your local app and the Azure app are accessing the same "resource" and that resource does not do authentication that maybe tied to the client environment, then yes, you can if course you can use the same keys. That does make your security exposure a bit bigger.
 
Is it possible to override my local app settings value from azure app configuration? (For instance if i'm not giving any key values in Azure app configuration then it should pick the value from my Local app settings)
This is completely dependent on how you write your code for loading configuration. The default .NET's configuration framework allows for overrides depending on the order that you load configuration files and environment variables. The framework is completely extensible so you can implement something custom if there is not an out of the box configuration implementation that suits your needs.
 
Keys to what? If both your local app and the Azure app are accessing the same "resource" and that resource does not do authentication that maybe tied to the client environment, then yes, you can if course you can use the same keys. That does make your security exposure a bit bigger.

For example assume I’m configuring a key value (FontColor:Black) in my local app settings and I am going to have the same key in azure app configuration (FontColor:Green) but the value is different. So my requirement is to override the FontColor in my local setting that should pull value at runtime from azure app configuration. Is it possible to do?

The reason for keeping the same key in both places is just to avoid the error by any reason if the azure endpoint is down then my application will pick the value from local settings.

Note: here the key is FontColor and value is (Black or Green)
 
This is completely dependent on how you write your code for loading configuration. The default .NET's configuration framework allows for overrides depending on the order that you load configuration files and environment variables. The framework is completely extensible so you can implement something custom if there is not an out of the box configuration implementation that suits your needs.

Thanks for your reply. I’m building a .net core application by any chance will you recommend any reference to take a look to mitigate my question.
 
So my requirement is to override the FontColor in my local setting that should pull value at runtime from azure app configuration. Is it possible to do?

You could create a page of the app that exports (parts of) the configuration, and then another part that downloads it and patches it in after the local connection settings have been loaded (but if azure is down, how will you get the settings? Just rely on having got them earlier when azure was up?)

It's a bit odd though.. Kinda like you can't decide where your app should run. You can configure things on azure so that there are two geo-separated locations running your app, the possibility of them both being down being so unlikely that you don't try and provide some local backup provision too

Usually when we develop azure stuff we have a set of settings that we don't care are exposed to the world if someone hacked the site, like font color.. and we have another set of settings that we do care to keep more secure, like api keys - they go in user secrets locally (so they aren't committed to source control) and they are configured in azure management portal for the live site. The default config system setup for settings merges the secure and insecure in both local and remote places so when running locally the insecure+secret settings are available as a merged, unified repository and when running on azure the insecure+portal settings are similarly available as a merged set. Note that the mechanism does NOT merge local and remote settings together
 
Last edited:
Back
Top Bottom