sample-app-aoai-chatGPT
sample-app-aoai-chatGPT copied to clipboard
[feature] Adding RBAC use for Azure OpenAI calls (as already done for Cosmos)
The current solution should allow using Azure services with both options: key or RBAC.
It has been partly done:
- for CosmosDB, you can use key (AZURE_COSMOSDB_ACCOUNT_KEY setting) or it will fallback with
DefaultAzureCredential()
if not provided (see here: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/654953b63eb693aa2ca7d72c146c1e2e7b53e555/app.py#L134) - for Azure OpenAI, RBAC setup has been implemented in the infra folder (see bicep file here: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/654953b63eb693aa2ca7d72c146c1e2e7b53e555/infra/main.bicep#L254) but it is not used in the main code
This pull request adds the same behavior as for CosmosDB:
- if the Azure OpenAI key setting (AZURE_OPENAI_KEY) has a value, it will be used
- else, it will try to use
DefaultAzureCredential()
Hi @sarah-widder and @iseabock ,
I hope this pull request will be helpful to add features to this great sample. Can you confirm that you don't need additional details to be able to validate / merge this PR?
Thanks
Nicolas R. Microsoft AI MVP
Closing it, as this feature has been implemented in another PR