Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env sh
# author: Gary A. Stafford
# site: https://programmaticponderings.com
# license: MIT License
set -ex
LOCATION="<value_goes_here>"
RESOURCE_GROUP="<value_goes_here>"
ACCOUNT_NAME="<value_goes_here>"
COSMOS_ACCOUNT_KEY="<value_goes_here>"
DB_NAME="<value_goes_here>"
COLLECTION_NAME="<value_goes_here>"
az login
az cosmosdb create \
--name ${ACCOUNT_NAME} \
--resource-group ${RESOURCE_GROUP} \
--location "East US=0" \
--kind MongoDB
az cosmosdb database create \
--name ${ACCOUNT_NAME} \
--db-name ${DB_NAME} \
--resource-group-name ${RESOURCE_GROUP} \
az cosmosdb collection create \
--collection-name ${COLLECTION_NAME} \
--name ${ACCOUNT_NAME} \
--db-name ${DB_NAME} \
--resource-group-name ${RESOURCE_GROUP} \
--throughput 400 \
--key ${COSMOS_ACCOUNT_KEY}\
--verbose --debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment