Microsoft Azure Developer Associate AZ-204 Practice Question

You deploy a .NET 6 Web API to Azure App Service. The API must read a database connection string that is stored as a secret in Azure Key Vault at runtime. A system-assigned managed identity is enabled for the App Service instance and granted access to the vault. Which authentication approach should you implement in the code to retrieve the secret without adding any credentials or configuration values to the application?

  • Instantiate SecretClient by passing the Key Vault URI and an instance of DefaultAzureCredential.

  • Create a ClientSecretCredential with the App Service application ID and a new client secret, then use it with SecretClient.

  • Configure EnvironmentCredential with the vault URL in an environment variable and use it to access Key Vault.

  • Authenticate with AzureCliCredential, then call SecretClient to get the secret.

Microsoft Azure Developer Associate AZ-204
Implement Azure security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot