You are configuring a secure ASP.NET Core web application hosted in an Azure App Service to load configuration settings from an Azure App Configuration store. The configuration store contains key-values that reference secrets stored in an Azure Key Vault. You want to use a system-assigned managed identity to authenticate and authorize all access between these resources without storing credentials. In which order should you perform the steps to configure the security and connection between these services?
- 1Enable a system-assigned managed identity on the Azure App Service.
- 2Assign the 'App Configuration Data Reader' role to the App Service's managed identity on the Azure App Configuration store.
- 3Assign the 'Key Vault Secrets User' role to the App Service's managed identity on the Azure Key Vault.
- 4Configure the App Service application settings to specify the App Configuration endpoint, and update the application startup code to use DefaultAzureCredential.
Answer
To configure the security and connection, you must first enable a system-assigned managed identity on the Azure App Service. Next, assign the 'App Configuration Data Reader' role to the App Service's managed identity on the App Configuration store. Then, assign the 'Key Vault Secrets User' role to the App Service's managed identity on the Key Vault. Finally, configure the App Service application settings to specify the App Configuration endpoint, and update the application startup code to initialize the configuration provider using DefaultAzureCredential.
The correct order requires establishing the system-assigned managed identity first. Once the identity exists, permissions must be assigned to it on both the Azure App Configuration store (App Configuration Data Reader) and the Azure Key Vault (Key Vault Secrets User). Finally, the App Service configuration must be updated with the endpoint, and the code updated to load configuration via DefaultAzureCredential.
Step-by-Step Solution
Key Concept
Secure App Configuration and Key Vault References using Managed Identity
Estimated Time:2m 0s