Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active August 24, 2018 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/bfe844491eeb74b20cc698682c332681 to your computer and use it in GitHub Desktop.
Save garystafford/bfe844491eeb74b20cc698682c332681 to your computer and use it in GitHub Desktop.
#!/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