Is it possible to connect use dedicated gateway and integrated cache with managed identity from python sdk

Abhit Pahwa 0 Reputation points
2024-09-26T13:35:20.1533333+00:00

I wanted to connect from azure function (python) to azure cosmos nosql database with managed identity credential. As far as I understand from https://video2.skills-academy.com/en-us/azure/cosmos-db/how-to-configure-integrated-cache, I did not find anything apart from connection strings.

With following code, I am able to work with cosmosdb account URL, but there are no hits on integrated cache:

cosmos_uri = get_cosmos_url(environment)
credential = ManagedIdentityCredential(client_id=os.environ["AZURE_CLIENT_ID"])
client = CosmosClient(cosmos_uri,credential)

It is mentioned to send consistency level with each request for python SDK, but I cannot find any option to do so in https://azuresdkdocs.blob.core.windows.net/$web/python/azure-cosmos/4.7.0/azure.cosmos.html

Kindly guide.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,631 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.