Complete the code to enable Key Vault references in an Azure App Service configuration.
appSettings = {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=storageaccount;AccountKey=[1];EndpointSuffix=core.windows.net"
}To reference a secret from Azure Key Vault in App Service settings, use the syntax @Microsoft.KeyVault(SecretUri=...).
Complete the code to add a Key Vault reference in the App Service's application settings JSON.
{
"properties": {
"appSettings": [
{
"name": "MySecret",
"value": "[1]"
}
]
}
}The value for a Key Vault reference in App Service appSettings must use the @Microsoft.KeyVault(SecretUri=...) format with the full secret URI.
Fix the error in the Key Vault reference syntax in the app setting value.
"MySecret": "[1]"
The correct syntax for Key Vault references uses @Microsoft.KeyVault(SecretUri=...). Other variants are invalid.
Fill both blanks to correctly configure an App Service setting with a Key Vault reference and enable system-assigned managed identity.
{
"identity": {
"type": "[1]"
},
"siteConfig": {
"appSettings": [
{
"name": "MySecret",
"value": "[2]"
}
]
}
}To use Key Vault references, enable system-assigned managed identity with "SystemAssigned" and set the app setting value with the full Key Vault reference syntax.
Fill all three blanks to configure an App Service with a user-assigned managed identity and a Key Vault reference in app settings.
{
"identity": {
"type": "[1]",
"userAssignedIdentities": {
"[2]": {}
}
},
"siteConfig": {
"appSettings": [
{
"name": "DatabasePassword",
"value": "[3]"
}
]
}
}For user-assigned managed identity, set "type": "UserAssigned", specify the identity resource ID, and use the Key Vault reference syntax for the secret.