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

Cosmosdb auth patch #1792

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

basitanees
Copy link

Description

Added support for cosmosdb to use AccountKey from the api_key parameter in vector store (as we currently do not have a connection_string parameter for the vector store in the GraphRAGConfig)

Related Issues

#1791

Proposed Changes

store the access_key in the api_key parameter, and then call cosmos_client in (vector_stores/cosmosdb.py) like this:

access_key = kwargs.get("api_key")
if access_key:
  self._cosmos_client = CosmosClient(
                  url=url, credential=access_key
              )
else:
  self._cosmos_client = CosmosClient(
                  url=url, credential=DefaultAzureCredential()
              )

Checklist

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

Additional Notes

In future, we can also consider adding the connection_string parameter to the VectorStoreConfig

@basitanees basitanees requested review from a team as code owners March 6, 2025 22:55
@basitanees
Copy link
Author

@microsoft-github-policy-service agree

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

Successfully merging this pull request may close these issues.

1 participant