Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

README.rst

Create CosmosDB Database and Corresponding User

Script creates a database in CosmosDB container and a corresponding user. As output, it prints a temporary token for the user.

Notice: cosmosdb does not support users as you would expect in a database. You have to use your service keys (az cosmosdb get-keys --resource-group RESOURCE_GROUP --name COSMOSDB_CONTAINER) or temporary user/token. The temporary user/token will not work if you want to use the mongodb client.

# az cosmosdb show --resource-group RESOURCE_GROUP --name COSMOSDB_NAME --query 'documentEndpoint' -o tsv
export COSMOSDB_ENDPOINT=
# az cosmosdb list-keys --resource-group RESOURCE_GROUP --name COSMOSDB_NAME --query 'primaryMasterKey' -o tsv
export COSMOSDB_MASTERKEY=
export USER_NAME=
export DB_NAME=

python create_db_and_creds.py

If you want to automatize CosmosDB, the best source are the tests for CosmosDB python client. You will find the links below.

Reference

About

Script that creates a user for your cosmosdb container.

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.