Search code examples
azureazure-functionsazure-app-configuration

Azure App Configuration references are not resolved in local.settings.json


I'm trying to use Azure App Configuration in combination with a Service Bus trigger in an isolated Function App (.NET 8). As per this suggestion I've tried to reference the App Configuration value as an app setting. This seems to work in Azure, as the reference shows a green checkmark. However, locally I'm just getting the unresolved value @Microsoft.AppConfiguration(Endpoint=<myendpoint>; Key=<mykey>;).

Permissions are set up correctly, because I can resolve the values through the IConfigurationRoot. So I'm not sure whether this is something that just won't work.


Solution

  • Azure App Configuration references are not resolved in local.settings.json

    App Configuration references only work in Azure, not locally. Alternatively, you can use environment variables or secrets from secret file in local but not app configuration values.

    If you are looking for security reasons, You can store connection string as secret in keyvault now you can get the value from keyvault using this in local.settings.json:

    {
        "IsEncrypted": false,
      "Values": {
        "AzureWebJobsStorage": "",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
        "rithcon": "@Microsoft.KeyVault(VaultName=keyvaultname;SecretName=keyname)"
      }
    }
    

    enter image description here

    You can also use environment varaibles too.