You are developing an application that uses Azure OpenAI. You need to ensure that the application can authenticate to the Azure OpenAI service without storing credentials in code. What should you use?
Azure OpenAI supports Azure AD authentication, allowing applications to authenticate using managed identities without storing any credentials. The application can request a token from Azure AD and use it to call the service. This is the recommended approach for passwordless authentication and integrates with Azure role-based access control.
Why this answer
Azure AD authentication with managed identities allows your application to authenticate to Azure OpenAI without any stored credentials. The managed identity is assigned to the application's hosting resource, and Azure AD issues tokens that the application uses to access the service. This eliminates secret management and is the recommended practice.
Exam trap
The trap here is assuming that storing credentials in a secure store like Key Vault or App Configuration makes them passwordless; managed identities are the true passwordless solution.