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.43k stars 2.14k forks source link

Cosmos Database stops logging Chat History on Code Sync #889

Closed speedbunny closed 2 weeks ago

speedbunny commented 1 month ago

Describe the bug Cosmos Database stops logging conversations on Code Sync. Show Chat History button does not appear anymore.

To Reproduce Steps to reproduce the behavior:

  1. Sync code from default repository

Expected behavior No environment settings have changed, so the Cosmos database should continue to log conversations.

Screenshots If applicable, add screenshots to help explain your problem.

Configuration: Please provide the following

Additional context

John-Vance commented 1 month ago

I am seeing the same right now.

I noticed that there was no AZURE_COSMOSDB_ACCOUNT_KEY environment variable, though the other COSMOSDB variables were configured. I added it and manually copied the key and this seemed to resolve it after a few minutes.

John-Vance commented 1 month ago

Update: Actually it seems like manually adding the CosmosDB account key env variable did fix it, just had to give it a few.

speedbunny commented 1 month ago

Can confirm that re-adding the AZURE_COSMOSDB_ACCOUNT_KEY environment variable manually after syncing fixes the issue. Hopefully whatever is over-writing it can be fixed in future versions.

abhahn commented 1 month ago

@iseabock , could you take a look at the refactored settings code when you have time to see if you can repro this issue?

aspexdata commented 1 month ago

We also ran in to the same issue recently using Azure OpenAI Studio deployment across different models and regions. I can confirm this workaround of adding back AZURE_COSMOSDB_ACCOUNT_KEY env variable manually also helped to resolve the issue for us, and now able to see chat history again too on the UI. Thanks for sharing!

sarah-widder commented 2 weeks ago

Fixed by #915