sample-app-aoai-chatGPT icon indicating copy to clipboard operation
sample-app-aoai-chatGPT copied to clipboard

The local setup port is 8000, but start.cmd automatically opens port 50505

Open wyl765 opened this issue 11 months ago • 5 comments

Describe the bug There are two issues

  1. the start.cmd opens http://127.0.0.1:50505 but the terminal say it is running at http://127.0.0.1:8000, I can open 8000 but cannot open 50505
  2. I disabled the auth using AUTH_ENABLED=False, the site can open, but the completion failed with 401. the error is image

Screenshots image

Configuration: Please provide the following

  • Azure OpenAI model name and version (e.g. 'gpt-35-turbo-16k, version 0613')
  • Is chat history enabled?
  • No
  • Are you using data? If so, what data source? (e.g. Azure AI Search, Azure CosmosDB Mongo vCore, etc) No Additional context Add any other context about the problem here.

wyl765 avatar Feb 26 '24 04:02 wyl765

Hi @wyl765 since #643 the start.cmd has been fixed with the right port. For the 401 error - have you specified the AZURE_OPENAI_KEY in your .env file?

sarah-widder avatar Feb 27 '24 19:02 sarah-widder

@sarah-widder , yes, I specified the AZURE_OPENAI_KEY in .env file. Also seems the error message is complaining about AAD token, I disabled the auth by setting AUTH_ENABLED=False.

wyl765 avatar Feb 28 '24 03:02 wyl765

@wyl765 , I managed to get one step further, by running az login before running the example (with AUTH_ENABLED=False):

image

After this I noticed the AZURE_OPENAI_KEY setting had reset. Configuring that correctly again and restarting made things work!

rajbos avatar Sep 26 '24 20:09 rajbos

Added a PR with more guidance in the README: #1119

rajbos avatar Sep 26 '24 21:09 rajbos

Just to clarify here, if AZURE_OPENAI_KEY is not set, when running locally, the AOAI Chat Completions call will be done using your user DefaultAzureCredential(). So your user identity needs to be logged in (run az login) and have data plane access to the AOAI resource (Cognitive Services OpenAI User role).

sarah-widder avatar Sep 26 '24 21:09 sarah-widder