AI-102 Question 81
Select 4You are developing an application that uses Azure Cognitive Services for text analysis. The application must authenticate securely to the Azure AI Service resource without embedding credentials in the application code. Which authentication methods can you use to achieve this?
- A
Use a managed identity assigned to the Azure resource hosting the application
- B
Use an API key stored in the application code
- C
Use Azure Active Directory (Azure AD) to obtain an access token
- D
Use a user-assigned managed identity to authenticate the application
- E
Use an API key stored in Azure Key Vault and retrieved at runtime
Show answer and explanation
Correct answers: A, C, D, E
Explanation
Secure authentication is critical when accessing Azure AI Services. Managed identities (system-assigned or user-assigned) and Azure Active Directory tokens are preferred methods as they avoid hardcoding credentials. Storing API keys in Azure Key Vault enhances security by providing a secure mechanism to retrieve credentials at runtime. Storing API keys directly in application code is discouraged due to the risk of exposure.
- A. Correct.
Using a managed identity assigned to the hosting resource is a secure authentication method because it avoids embedding credentials in the application code and is natively supported by Azure AI Services.
- B. Incorrect.
Storing an API key in application code is not recommended as it exposes sensitive credentials and is not considered secure.
- C. Correct.
Azure AD can be used to obtain an access token for authentication, providing a secure and scalable way to authenticate to Azure AI Services.
- D. Correct.
A user-assigned managed identity is a secure and flexible method for authentication, as it allows the identity to be shared across multiple resources.
- E. Correct.
Using an API key stored in Azure Key Vault and retrieved securely at runtime is a recommended practice for managing credentials, as it avoids embedding the key in the application code.