nerdexam
Microsoft

AZ-204 · Question #487

Drag and Drop Question You are developing an Azure solution. You need to develop code to access a secret stored in Azure Key Vault. How should you complete the code segment? To answer, drag the…

The correct answer is SecretClient; ClientSecretCredential; DefaultAzureCredential. To access a secret in Azure Key Vault, you first instantiate a SecretClient (the class that provides methods to interact with Key Vault secrets), then provide the vault URI along with a credential object. DefaultAzureCredential is the recommended credential type as it…

Submitted by salim_om· Mar 30, 2026Develop for Azure Storage and Implement Azure Security - specifically implementing secure access to Azure Key Vault secrets using the Azure Identity and Key Vault SDK libraries (AZ-204 / Azure Developer certification)

Question

Drag and Drop Question You are developing an Azure solution. You need to develop code to access a secret stored in Azure Key Vault. How should you complete the code segment? To answer, drag the appropriate code segments to the correct location. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Exhibit

AZ-204 question #487 exhibit

Answer Area

Drag items

DefaultAzureCredentialClientSecretCredentialCloudClientsSecretClient

Correct arrangement

  • SecretClient
  • ClientSecretCredential
  • DefaultAzureCredential

Explanation

To access a secret in Azure Key Vault, you first instantiate a SecretClient (the class that provides methods to interact with Key Vault secrets), then provide the vault URI along with a credential object. DefaultAzureCredential is the recommended credential type as it automatically tries multiple authentication methods (environment variables, managed identity, Visual Studio, Azure CLI, etc.) in sequence, making it ideal for both local development and production Azure environments. ClientSecretCredential is a valid credential class but requires explicit client ID, tenant ID, and client secret parameters - it is not the preferred modern approach when DefaultAzureCredential can handle the authentication chain automatically.

Topics

#Azure Key Vault#Azure SDK Authentication#DefaultAzureCredential#Managed Identity

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice