Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent chat history with Cosmos DB is not working #2243

Open
mahdyshabeeb opened this issue Dec 18, 2024 · 3 comments
Open

Persistent chat history with Cosmos DB is not working #2243

mahdyshabeeb opened this issue Dec 18, 2024 · 3 comments

Comments

@mahdyshabeeb
Copy link

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I enabled the persistent chat history feature following the provided guide (setting USE_CHAT_HISTORY_COSMOS to true and running azd up). However, when clicking on "Open chat history" in the web app no history is displayed, even after sending some questions and getting answers.
When deactivating this feature and activating the client-side chat history, it works and the chat history can be viewed.
The environment variable AZURE_COSMODB_ACCOUNT is filled correctly and a respective Cosmos-DB account was created. However, no data can be seen there.

Any log messages given by the failure

TIMESTAMP - IP_ADDRESS:0 - "POST /chat_history/items HTTP/1.1" 401

Expected/desired behavior

The history should be filed as soon as I receive the answer on my 1st prompt from GPT.

OS and Version?

My local device has Windows 10 but I'm running the application on Azure.

azd version?

azd version 1.11.0 (commit 5b92e0687e1fa96dfc8292f4b900c0c58610b6a5)

Versions

Mention any other details that might be useful

@bnodir
Copy link
Contributor

bnodir commented Dec 18, 2024

This feature allows authenticated users to view the chat history of their conversations, stored in the server-side storage using [Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db/).This option requires that authentication be enabled. The chat history will be persistent and accessible from any device where the user logs in with the same account. To enable server-stored chat history, run:

Did you also enable authentication?

@mahdyshabeeb
Copy link
Author

This feature allows authenticated users to view the chat history of their conversations, stored in the server-side storage using [Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db/).This option requires that authentication be enabled. The chat history will be persistent and accessible from any device where the user logs in with the same account. To enable server-stored chat history, run:

Did you also enable authentication?

Yes I did

@mahdyshabeeb
Copy link
Author

The problem was, that we needed to add admin consent to the server app as mentioned in the last point of the Troubleshooting section of the guide
image
Is there a possibility of making troubleshooting this issue more straightforward? (Currently the only options are asking the admins whether they implemented that policy or trial and error).
It's also totally unclear why that is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants