Azure / azure-cosmos-python

🚨🚨🚨This SDK is now maintained at https://github.com/Azure/azure-sdk-for-python 🚨🚨🚨
https://github.com/Azure/azure-sdk-for-python
MIT License
150 stars 141 forks source link

CosmosClient to use connectionstring #141

Closed mindlessroman closed 4 years ago

mindlessroman commented 5 years ago

Similar to azure-cosmos-js's issue #184, the Python SDK lacks the feature parity to the .NET CosmosClient class. A bit of a bummer; in the meantime, will have to parse a provided connection string. If the SDK is being provided in another language, having the same features across the original and other SDKs should be expected.

wkeithvan commented 4 years ago

+1... Azure needs to be able to support parsing its own format and not rely on the end user to write a parsing script for this.

MaLiN2223 commented 4 years ago

Looks like this is solved in version 4.0.0b2 from the changelog:

A new classmethod constructor has been added to CosmosClient to enable creation via a connection string retrieved from the Azure portal.

You can now

from azure.cosmos import cosmos_client
cosmos_client.CosmosClient.from_connection_string(connection_string)