An administrator is configuring a Web App named `inventory-api` on Azure App Service. The application must satisfy the following requirements:
1. Retrieve database credentials from Azure Key Vault without storing them in the application code.
2. Authenticate to the Key Vault using a managed identity that is tied to the lifecycle of the Web App.
3. Automatically increase the instance count when CPU usage exceeds 80%, and decrease the instance count when CPU usage drops below 70% without causing flapping.
Which two of the following configuration actions must you perform? Select two.
- Assign a system-assigned managed identity to the Web App and grant it GET access to the Key Vault secrets.Cevap
- Create an application setting for the database credential that uses the value `@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-password)`.Cevap
- CAssign a user-assigned managed identity to the Web App to ensure the identity is automatically cleaned up when the Web App is deleted.
- DCreate an application setting for the database credential that uses the value `@Microsoft.AppConfiguration(KeyVaultUri=https://kv-prod.vault.azure.net/secrets/db-password/)`.
- EConfigure a scale-out autoscale rule with a CPU threshold of 80% and a scale-in autoscale rule with a CPU threshold of 85%.
Cevap
Assign a system-assigned managed identity to the Web App and grant it GET access to the Key Vault secrets, and create an application setting for the database credential that uses the value `@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-password)`.
Assigning a system-assigned managed identity fulfills the lifecycle requirement since system-assigned identities are deleted automatically when the associated Web App is deleted. Granting GET access allows the App Service to fetch the secret values. The App Service Key Vault reference syntax `@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-password)` allows the app setting to fetch the value securely from Key Vault.
Adım Adım Çözüm
Anahtar Kavram
Configuring App Service App Settings, Managed Identities, Key Vault references, and autoscale rules.