Connecting to Cosmos¶
Anaconda Enterprise enables you to connect to a Microsoft Azure Cosmos distributed database, to access data stored in it.
Before you can do so, however, you’ll need to install the libraries that are required to connect to the Cosmos database:
Tip
You can also download the Cosmos DB Python SDK and access relevant documentation from Microsoft.
When you use conda install
to add a package during a session, the project is impacted temporarily, during the current session only. If you want the change to persist for future project sessions and deployments, be sure to add the package to the project’s anaconda-project.yml
file. For more information, see Developing a project.
You’ll also need to obtain the values for the connection keys required from your Azure account.
See Storing secrets for information about adding credentials to the platform, to make them available in your projects. Any secrets you add will be available across all sessions and deployments associated with your user account.
After you’ve installed the correct driver and gathered the connection information for your Azure account, you can then use code such as this to access the database from within a notebook session: