azureazure-active-directoryazure-web-app-serviceazure-keyvault

is it posible to access Azure App Configuration via URL or conected some how as enviroment setting of App Service?


On my App Service i have several KeyVaults pinting to diferents URL's. I create a layer on App Configuration that depending if the Label point to Dev-DB, QA-DB, o Stage-DB Change the database of the App Service.

All my app services have on Environment variables, inside Connection strings all the diferent databases. Inside of the Value i have this: "@Microsoft.KeyVault(SecretUri=https://{MyKeyvault}.vault.azure.net/secrets/{MyVariable}/)+\"Application Name={UserOfDB};\"",

And i want to use somthing like this: "@Microsoft.AppConfiguration(https://{MyAppConfig}.azconfig.net;Id={IdConfig};Secret={MySecret};Key={MyVariable};Label=${MyEnviromentVariable}) + \"Application Name={UserOfDB};\"",

But it gave me this error: Identity: System assigned managed identity Status: InvalidSyntax Error details: Reference was not able to be resolved because invalid reference syntax found.

I just need a way to easy switch between Databases without losing my mind in the process.


Solution

  • is it posible to access Azure App Configuration via URL or conected some how as enviroment setting of App Service?

    Yes, it is possible to access the App Configuration keys as @Microsoft.AppConfiguration in the Azure App Service Environment Variables.

    Check the below work around to add key as AppConfiguration reference in App Service:

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    @Microsoft.AppConfiguration(Endpoint=https://harshuappconfig.azconfig.io; Key=SampleKey)
    
    MSINotEnabled - Reference was not able to be resolved because site Managed Identity not enabled.
    

    enter image description here

    App Configuration reference was not resolved because site was denied access to the App Config store.
    

    With Import/Export option, it is clear that adding Configuration settings with App Configuration reference is possible. But make sure you have enough permissions to access the App Configuration.