I want to read the azure application setting of the azure app service in angular for the solution of multiple environments in angular.
I want to read the azure application setting of the azure app service in angular for the solution of multiple environments in angular.
@SoftwareDeveloper-8088 You can use the Azure App Configuration Service to centrally manage application settings and feature flags for your app.
There is a npm package available for Azure App Configuration Service here: https://www.npmjs.com/package/@azure/app-configuration, which can be used as follows:
const appConfig = require("@azure/app-configuration");
const client = new appConfig.AppConfigurationClient(
"<App Configuration connection string goes here>"
);
async function run() {
const newSetting = await client.setConfigurationSetting({
key: "testkey",
value: "testvalue",
label: "optional-label"
});
let retrievedSetting = await client.getConfigurationSetting("testkey", {
label: "optional-label"
});
console.log("Retrieved value:", retrievedSetting.value);
}
run().catch((err) => console.log("ERROR:", err));
However, please be aware of the caveats with regards to security and performance that come with using App Config on the client-side, as described in the following posts:
Additional resources:
@bhargaviannadevara-msft It's a bit weird to store app settings in App Config service separately while App Service actually has its own app settings. Meanwhile, ASP.NET web app gets native support........... (Working with App Settings and Azure App Services)
@CharlieChen-9696 Yes, it is true that App Services have their own mechanism to handle configuration settings. However, due to the distributed nature of cloud applications in general, spreading configuration settings across these components can lead to hard-to-troubleshoot errors during an application deployment.
Azure App Configuration provides a service to centrally manage application settings and feature flags. One can use App Configuration to store all the settings for their application and secure their accesses in one place. Check out the other benefits of using Azure App Configuration here: Why use App Configuration?
(Please note that the azure-app-configuration tag is specifically meant for questions related to the Azure App configuration Service)
5 people are following this question.