I'm working with Azure OpenAI service, and want to test its Managed Identity support. According to the docs it supports Managed Identity authentication, for example - using a VM.
So I did the following:
But I keep getting a 401 error.
What am I missing? With other services, VM with authenticated Managed Identity can access the service (ie. Storage Account, KeyVault). Why isn't it working here?
In order to access Azure Open AI service, you still need an authentication header.
The difference that has a managed identity configured is instead of using api key, you can also use an access token to access the service.
You can take https://github.com/openai/openai-python#microsoft-azure-active-directory-authentication as a reference about how to get the access token with managed identity.
(I am a Microsoft employee working in the Azure SDK team.)