Rajnish Soni Thanks for the details, In Azure Open AI key and Endpoint section have regenerate the keys in the case of compromise or to comply with organization’s key rotation process. Two keys are provided to allow for continued access to the service while other key is being rotated.
Here simple bit of code using the OpenAI Python SDK. In the code provide a prompt to the model and ask it to complete it for me and use one of the API keys to authenticate to it.
https://journeyofthegeek.com/2023/04/02/authentication-in-azure-openai-service/
But you can utilise AAD-based tokens as well, as AOAI is based on the Azure Cognitive-aligned platform. So, if you will generate a Bearer token in Azure AD and pass it over to the same Azure OpenAI endpoint, but using slightly different header's key "Authorization", then you would be able to retrieve the same data.