AI-102 Question 85
Single answerYou are responsible for managing authentication for an Azure Cognitive Services resource. The development team requires secure access to the resource from their application without exposing the service's keys in the codebase. Which method should you implement to ensure secure authentication?
- A
Use Managed Identities for Azure resources to access the Cognitive Services resource.
- B
Embed the resource's API key directly in the application code.
- C
Store the resource's API key in Azure Key Vault and retrieve it during runtime.
- D
Grant public access to the Cognitive Services resource to avoid managing authentication.
Show answer and explanation
Correct answer: A
Explanation
Using Managed Identities for Azure resources is the most secure and recommended method to authenticate applications to Azure services like Cognitive Services. It eliminates the need to manage credentials, reducing the risk of exposure, and integrates seamlessly with Azure's identity and access management framework.
- A. Correct.
This is the correct option. Managed Identities allow applications on Azure to securely authenticate to resources without handling sensitive credentials such as API keys. It is the recommended approach for securing access to Azure resources.
- B. Incorrect.
Embedding API keys directly in the application code is insecure, as it increases the risk of keys being exposed in source control or during a breach.
- C. Incorrect.
While storing API keys in Azure Key Vault is more secure than embedding them in code, it still requires handling and managing the API key, which is less secure than using Managed Identities.
- D. Incorrect.
Granting public access to a Cognitive Services resource is not secure and should never be done in production environments, as it exposes the resource to unauthorized access.