-
Notifications
You must be signed in to change notification settings - Fork 0
/
general-operations-commands.sh
22 lines (13 loc) · 1.18 KB
/
general-operations-commands.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# to list all the database details from the cosmosdb account
az cosmosdb database list --subscription demo-sub-1 --resource-group-name demo-rg-1 --name demo-cosmos-account-name
# to show details of a database from a cosmosdb account
az cosmosdb collection list --subscription demo-sub-1 --resource-group-name demo-rg-1 --name demo-cosmos-account-name --db-name db-name-1
# to list all the collections details from a database and cosmosdb account
az cosmosdb collection list --subscription demo-sub-1 --resource-group-name demo-rg-1 --name demo-cosmos-account-name --db-name db-name-1
# to show details of a collection from a database and cosmosdb account
az cosmosdb collection show --subscription demo-sub-1 --resource-group-name demo-rg-1 --name demo-cosmos-account-name --db-name db-name-1 --collection-name test_coll-1
#can also do it with sql api
az cosmosdb sql container show --subscription demo-sub-1 --resource-group demo-rg-1 --account-name demo-cosmos-account-name --database-name db-name-1 --name test_coll-1
# to show the keys (primary/secondary) of the database account
az cosmosdb keys list --subscription demo-sub-1 --resource-group demo-rg-1 --name demo-cosmos-account-name