microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.54k stars 2.38k forks source link

Azure Government Endpoints #317

Open tsellie opened 10 months ago

tsellie commented 10 months ago

Where possible, I am attempting to use Azure Government endpoints instead of Azure Commercial. I have updated app.py as follows:

-  "endpoint": f"https://{AZURE_SEARCH_SERVICE}.search.windows.net",
+  "endpoint": f"https://{AZURE_SEARCH_SERVICE}.search.azure.us",

- cosmos_endpoint = f'https://{AZURE_COSMOSDB_ACCOUNT}.documents.azure.com:443/'
+ cosmos_endpoint = f'https://{AZURE_COSMOSDB_ACCOUNT}.documents.azure.us:443/'

- endpoint = "https://graph.microsoft.com/v1.0/me/transitiveMemberOf?$select=id"
+ endpoint = "https://graph.microsoft.us/v1.0/me/transitiveMemberOf?$select=id"

However, chat tests result in the following error that indicate that the commercial endpoint is still in use:

code: 400, message: "Call to get ACS index failed. Check you are using correct index, instance and api_key.\nCannot connect to host redacted.search.windows.net:443 ssl:default [Name or sevice not known]" }

Are endpoints defined anywhere else that I would need to modify?

tsellie commented 9 months ago

Changes to app.py not being reflected resolved via auto-reload setting in #73. New errors now being encountered when using government endpoints for search, cosmos, and graph. Will retrieve and post errors here at a later time.

sarah-widder commented 9 months ago

Hi @tsellie Azure OpenAI on your data is not yet supported in government clouds so it won't be able to access your search resource in the government cloud. For graph, you would need to ensure the app registration configured for authentication is in the right tenant in the right cloud so that the user token will have the right access. The graph API call is only needed for document-level access control if you have this configured on your search index.

aaronba commented 8 months ago

Along these lines, do you think you could update the code to support the full FQDN for the Azure Government CosmosDB endpoint? AZURE_COSMOSDB_ACCOUNT maybe with another Environment variable. Doing this would allow the use of Azure Government for CosmosDB without modifying app.py directly (by only setting Environment variables)

gw37 commented 6 months ago

Is there anything more recent about Bring your own Data in government cloud? Im trying to set this up and although we have an existing index the OAI studio throws error "no search indexes found for this resource". If unsupported is there a timeframe for this support? thank you