You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/manage-with-cli.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Use Azure CLI to manage your Azure Cosmos DB account, database and
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
7
-
ms.date: 01/21/2020
7
+
ms.date: 04/13/2020
8
8
ms.author: mjbrown
9
9
10
10
---
@@ -45,24 +45,24 @@ Create an Azure Cosmos account with two regions, add a region, and remove a regi
45
45
> This command allows you to add and remove regions but does not allow you to modify failover priorities or trigger a manual failover. See [Set failover priority](#set-failover-priority) and [Trigger manual failover](#trigger-manual-failover).
46
46
47
47
```azurecli-interactive
48
-
resourceGroupName = 'myResourceGroup'
49
-
accountName = 'mycosmosaccount' # must be lower case and <31 characters
48
+
resourceGroupName='myResourceGroup'
49
+
accountName='mycosmosaccount' # must be lower case and <31 characters
50
50
51
51
# Create an account with 2 regions
52
52
az cosmosdb create --name $accountName --resource-group $resourceGroupName \
53
-
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
54
-
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False
53
+
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
54
+
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False
55
55
56
56
# Add a region
57
57
az cosmosdb update --name $accountName --resource-group $resourceGroupName \
58
-
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
59
-
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False \
60
-
--locations regionName="South Central US" failoverPriority=2 isZoneRedundant=False
58
+
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
59
+
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False \
60
+
--locations regionName="South Central US" failoverPriority=2 isZoneRedundant=False
61
61
62
62
# Remove a region
63
63
az cosmosdb update --name $accountName --resource-group $resourceGroupName \
64
-
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
65
-
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False
64
+
--locations regionName="West US 2" failoverPriority=0 isZoneRedundant=False \
65
+
--locations regionName="East US 2" failoverPriority=1 isZoneRedundant=False
66
66
```
67
67
68
68
## Enable multiple write regions
@@ -71,8 +71,8 @@ Enable multi-master for a Cosmos account
71
71
72
72
```azurecli-interactive
73
73
# Update an Azure Cosmos account from single to multi-master
74
-
resourceGroupName = 'myResourceGroup'
75
-
accountName = 'mycosmosaccount'
74
+
resourceGroupName='myResourceGroup'
75
+
accountName='mycosmosaccount'
76
76
77
77
# Get the account resource id for an existing account
78
78
accountId=$(az cosmosdb show -g $resourceGroupName -n $accountName --query id -o tsv)
@@ -86,8 +86,8 @@ Set the failover priority for an Azure Cosmos account configured for automatic f
86
86
87
87
```azurecli-interactive
88
88
# Assume region order is initially 'West US 2'=0 'East US 2'=1 'South Central US'=2 for account
89
-
resourceGroupName = 'myResourceGroup'
90
-
accountName = 'mycosmosaccount'
89
+
resourceGroupName='myResourceGroup'
90
+
accountName='mycosmosaccount'
91
91
92
92
# Get the account resource id for an existing account
93
93
accountId=$(az cosmosdb show -g $resourceGroupName -n $accountName --query id -o tsv)
@@ -101,8 +101,8 @@ az cosmosdb failover-priority-change --ids $accountId \
101
101
102
102
```azurecli-interactive
103
103
# Enable automatic failover on an existing account
104
-
resourceGroupName = 'myResourceGroup'
105
-
accountName = 'mycosmosaccount'
104
+
resourceGroupName='myResourceGroup'
105
+
accountName='mycosmosaccount'
106
106
107
107
# Get the account resource id for an existing account
108
108
accountId=$(az cosmosdb show -g $resourceGroupName -n $accountName --query id -o tsv)
0 commit comments