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-powershell.md
+41-6Lines changed: 41 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ The following sections demonstrate how to manage the Azure Cosmos account, inclu
38
38
*[Regenerate keys for an Azure Cosmos account](#regenerate-keys)
39
39
*[List connection strings for an Azure Cosmos account](#list-connection-strings)
40
40
*[Modify failover priority for an Azure Cosmos account](#modify-failover-priority)
41
+
*[Trigger a manual failover for an Azure Cosmos account](#trigger-manual-failover)
41
42
42
43
### <aid="create-account"></a> Create an Azure Cosmos account
43
44
@@ -116,7 +117,9 @@ This command allows you to update your Azure Cosmos database account properties.
116
117
* Enabling Multi-master
117
118
118
119
> [!NOTE]
119
-
> This command allows you to add and remove regions but does not allow you to modify failover priorities or change the region with `failoverPriority=0`. To modify failover priority, see [Modify failover priority for an Azure Cosmos account](#modify-failover-priority).
120
+
> You cannot simultaneously add or remove regions `locations` and change other properties for an Azure Cosmos account. Modifying regions must be performed as a separate operation than any other change to the account resource.
121
+
> [!NOTE]
122
+
> This command allows you to add and remove regions but does not allow you to modify failover priorities or trigger a manual failover. See [Modify failover priority](#modify-failover-priority) and [Trigger manual failover](#trigger-manual-failover).
120
123
121
124
```azurepowershell-interactive
122
125
# Get an Azure Cosmos Account (assume it has two regions currently West US 2 and East US 2) and add a third region
For multi-region database accounts, you can change the order in which a Cosmos account will promote secondary read-replicas should a regional failover occur on the primary write replica. Modifying `failoverPriority=0` can also be used to initiate a disaster recovery drill to test disaster recovery planning.
239
+
For accounts configured with Automatic Failover, you can change the order in which Cosmos will promote secondary replicas to primary should the primary become unavailable.
237
240
238
-
For the example below, assume the account has a current failover priority of `West US 2 = 0` and `East US 2 = 1` and flip the regions.
241
+
For the example below, assume the current failover priority, `West US 2 = 0`, `East US 2 = 1`, `South Central US = 2`.
239
242
240
243
> [!CAUTION]
241
244
> Changing `locationName` for `failoverPriority=0` will trigger a manual failover for an Azure Cosmos account. Any other priority changes will not trigger a failover.
242
245
243
246
```azurepowershell-interactive
244
247
# Change the failover priority for an Azure Cosmos Account
245
-
# Assume existing priority is "West US 2" = 0 and "East US 2" = 1
248
+
# Assume existing priority is "West US 2" = 0, "East US 2" = 1, "South Central US" = 2
249
+
250
+
$resourceGroupName = "myResourceGroup"
251
+
$accountName = "mycosmosaccount"
252
+
253
+
$failoverRegions = @(
254
+
@{ "locationName"="West US 2"; "failoverPriority"=0 },
255
+
@{ "locationName"="South Central US"; "failoverPriority"=1 },
256
+
@{ "locationName"="East US 2"; "failoverPriority"=2 }
For accounts configured with Manual Failover, you can failover and promote any secondary replica to primary by modifying to `failoverPriority=0`. This operation can be used to initiate a disaster recovery drill to test disaster recovery planning.
271
+
272
+
For the example below, assume the account has a current failover priority of `West US 2 = 0` and `East US 2 = 1` and flip the regions.
273
+
274
+
> [!CAUTION]
275
+
> Changing `locationName` for `failoverPriority=0` will trigger a manual failover for an Azure Cosmos account. Any other priority change will not trigger a failover.
276
+
277
+
```azurepowershell-interactive
278
+
# Change the failover priority for an Azure Cosmos Account
279
+
# Assume existing priority is "West US 2" = 0, "East US 2" = 1, "South Central US" = 2
246
280
247
281
$resourceGroupName = "myResourceGroup"
248
282
$accountName = "mycosmosaccount"
249
283
250
284
$failoverRegions = @(
251
-
@{ "locationName"="East US 2"; "failoverPriority"=0 },
252
-
@{ "locationName"="West US 2"; "failoverPriority"=1 }
285
+
@{ "locationName"="South Central US"; "failoverPriority"=0 },
286
+
@{ "locationName"="East US 2"; "failoverPriority"=1 },
287
+
@{ "locationName"="West US 2"; "failoverPriority"=2 }
Copy file name to clipboardExpand all lines: articles/cosmos-db/powershell-samples-cassandra.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Azure PowerShell samples for Azure Cosmos DB - Cassandra API
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 07/03/2019
7
+
ms.date: 09/20/2019
8
8
ms.author: mjbrown
9
9
---
10
10
@@ -18,7 +18,8 @@ The following table includes links to sample Azure PowerShell scripts for Azure
18
18
|[List or get keyspaces or tables](scripts/powershell/cassandra/ps-cassandra-list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get keyspaces or tables. |
19
19
|[Get RU/s](scripts/powershell/cassandra/ps-cassandra-ru-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get RU/s for a keyspace or table. |
20
20
|[Update RU/s](scripts/powershell/cassandra/ps-cassandra-ru-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Update RU/s for a keyspace or table. |
21
-
|[Add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get an Azure Cosmos account and add a region to the list of locations. |
22
-
|[Change the failover priority](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the failover priority of an Azure Cosmos account with a manual failover trigger. |
23
-
|[Account keys and connection string tasks](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get the connection strings for an Azure Cosmos account. Get the primary and secondary keys of an Azure Cosmos account. Regenerate an account key. |
21
+
|[Update an account or add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Add a region to a Cosmos account. Can also be used to modify other account properties but these must be separate from changes to regions. |
22
+
|[Change failover priority or trigger failover](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the regional failover priority of an Azure Cosmos account or trigger a manual failover. |
23
+
|[Account keys or connection strings](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos account. |
24
+
|[Create a Cosmos Account with IP Firewall](scripts/powershell/common/ps-account-firewall-create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos account with IP Firewall enabled. |
Copy file name to clipboardExpand all lines: articles/cosmos-db/powershell-samples-gremlin.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Azure PowerShell samples for Azure Cosmos DB - Gremlin API
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 07/03/2019
7
+
ms.date: 09/20/2019
8
8
ms.author: mjbrown
9
9
---
10
10
@@ -18,7 +18,8 @@ The following table includes links to sample Azure PowerShell scripts for Azure
18
18
|[List or get databases or graphs](scripts/powershell/gremlin/ps-gremlin-list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get database or graph. |
19
19
|[Get RU/s](scripts/powershell/gremlin/ps-gremlin-ru-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get RU/s for a database or graph. |
20
20
|[Update RU/s](scripts/powershell/gremlin/ps-gremlin-ru-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Update RU/s for a database or graph. |
21
-
|[Add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get an Azure Cosmos account and add a region to the list of locations. |
22
-
|[Change the failover priority](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the failover priority of an Azure Cosmos account with a manual failover trigger. |
23
-
|[Account keys and connection string tasks](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get the connection strings for an Azure Cosmos account. Get the primary and secondary keys of an Azure Cosmos account. Regenerate an account key. |
21
+
|[Update an account or add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Add a region to a Cosmos account. Can also be used to modify other account properties but these must be separate from changes to regions. |
22
+
|[Change failover priority or trigger failover](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the regional failover priority of an Azure Cosmos account or trigger a manual failover. |
23
+
|[Account keys or connection strings](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos account. |
24
+
|[Create a Cosmos Account with IP Firewall](scripts/powershell/common/ps-account-firewall-create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos account with IP Firewall enabled. |
Copy file name to clipboardExpand all lines: articles/cosmos-db/powershell-samples-mongodb.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Azure PowerShell samples for Azure Cosmos DB - MongoDB API
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 07/03/2019
7
+
ms.date: 09/20/2019
8
8
ms.author: mjbrown
9
9
---
10
10
@@ -18,7 +18,8 @@ The following table includes links to sample Azure PowerShell scripts for Azure
18
18
|[List or get databases or collections](scripts/powershell/mongodb/ps-mongodb-list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get database or collection. |
19
19
|[Get RU/s](scripts/powershell/mongodb/ps-mongodb-ru-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get RU/s for a database or collection. |
20
20
|[Update RU/s](scripts/powershell/mongodb/ps-mongodb-ru-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Update RU/s for a database or collection. |
21
-
|[Add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get an Azure Cosmos account and add a region to the list of locations. |
22
-
|[Change the failover priority](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the failover priority of an Azure Cosmos account with a manual failover trigger. |
23
-
|[Account keys and connection string tasks](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get the connection strings for an Azure Cosmos account. Get the primary and secondary keys of an Azure Cosmos account. Regenerate an account key. |
21
+
|[Update an account or add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Add a region to a Cosmos account. Can also be used to modify other account properties but these must be separate from changes to regions. |
22
+
|[Change failover priority or trigger failover](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the regional failover priority of an Azure Cosmos account or trigger a manual failover. |
23
+
|[Account keys or connection strings](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos account. |
24
+
|[Create a Cosmos Account with IP Firewall](scripts/powershell/common/ps-account-firewall-create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos account with IP Firewall enabled. |
Copy file name to clipboardExpand all lines: articles/cosmos-db/powershell-samples-sql.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,15 @@ description: Azure PowerShell samples for Azure Cosmos DB - SQL (Core) API
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 07/03/2019
7
+
ms.date: 09/20/2019
8
8
ms.author: mjbrown
9
9
---
10
10
11
-
# Azure PowerShell samples for Azure Cosmos DB SQL (Core) API
11
+
# Azure PowerShell samples for Azure Cosmos DB - SQL (Core) API
12
12
13
-
The following table includes links to commonly used Azure PowerShell scripts for Azure Cosmos DB for SQL (Core) API.. For a complete listing of all PowerShell scripts see, [Cosmos DB PowerShell Samples for SQL (Core) API on GitHub](https://github.com/Azure/azure-docs-powershell-samples/tree/master/cosmosdb/sql)
13
+
The following table includes links to commonly used Azure PowerShell scripts for Azure Cosmos DB for SQL (Core) API. If you'd like to fork these PowerShell samples for Cosmos DB from our GitHub repository visit, [Cosmos DB PowerShell Samples on GitHub](https://github.com/Azure/azure-docs-powershell-samples/tree/master/cosmosdb).
14
+
15
+
For additional Cosmos DB PowerShell samples for SQL (Core) API and documentation see, [Manage Azure Cosmos DB SQL API resources using PowerShell](manage-with-powershell.md). For Cosmos DB PowerShell samples for other APIs see, [Cassandra API](powershell-samples-cassandra.md), [MongoDB API](powershell-samples-mongodb.md), [Gremlin API](powershell-samples-gremlin.md), and [Table API](powershell-samples-table.md).
14
16
15
17
|||
16
18
|---|---|
@@ -19,8 +21,9 @@ The following table includes links to commonly used Azure PowerShell scripts for
19
21
|[List or get databases or containers](scripts/powershell/sql/ps-sql-list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get database or containers. |
20
22
|[Get RU/s](scripts/powershell/sql/ps-sql-ru-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get RU/s for a database or container. |
21
23
|[Update RU/s](scripts/powershell/sql/ps-sql-ru-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Update RU/s for a database or container. |
22
-
|[Add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get an Azure Cosmos account and add a region to the list of locations. |
23
24
|[Create a container with no index policy](scripts/powershell/sql/ps-sql-container-create-index-none.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos container with index policy turned off.|
24
-
|[Change the failover priority](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the failover priority of an Azure Cosmos account with a manual failover trigger. |
25
-
|[Account keys and connection string tasks](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get the connection strings for an Azure Cosmos account. Get the primary and secondary keys of an Azure Cosmos account. Regenerate an account key. |
25
+
|[Update an account or add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Add a region to a Cosmos account. Can also be used to modify other account properties but these must be separate from changes to regions. |
26
+
|[Change failover priority or trigger failover](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the regional failover priority of an Azure Cosmos account or trigger a manual failover. |
27
+
|[Account keys or connection strings](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos account. |
28
+
|[Create a Cosmos Account with IP Firewall](scripts/powershell/common/ps-account-firewall-create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos account with IP Firewall enabled. |
Copy file name to clipboardExpand all lines: articles/cosmos-db/powershell-samples-table.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Azure PowerShell samples for Azure Cosmos DB - Table API
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 07/03/2019
7
+
ms.date: 09/20/2019
8
8
ms.author: mjbrown
9
9
---
10
10
@@ -18,7 +18,8 @@ The following table includes links to sample Azure PowerShell scripts for Azure
18
18
|[List or get tables](scripts/powershell/table/ps-table-list-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| List or get tables. |
19
19
|[Get RU/s](scripts/powershell/table/ps-table-ru-get.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get RU/s for a table. |
20
20
|[Update RU/s](scripts/powershell/table/ps-table-ru-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Update RU/s for a table. |
21
-
|[Add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get an Azure Cosmos account and add a region to the list of locations. |
22
-
|[Change the failover priority](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the failover priority of an Azure Cosmos account with a manual failover trigger. |
23
-
|[Account keys and connection string tasks](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get the connection strings for an Azure Cosmos account. Get the primary and secondary keys of an Azure Cosmos account. Regenerate an account key. |
21
+
|[Update an account or add a region](scripts/powershell/common/ps-account-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Add a region to a Cosmos account. Can also be used to modify other account properties but these must be separate from changes to regions. |
22
+
|[Change failover priority or trigger failover](scripts/powershell/common/ps-account-failover-priority-update.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Change the regional failover priority of an Azure Cosmos account or trigger a manual failover. |
23
+
|[Account keys or connection strings](scripts/powershell/common/ps-account-keys-connection-strings.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Get primary and secondary keys, connection strings or regenerate an account key of an Azure Cosmos account. |
24
+
|[Create a Cosmos Account with IP Firewall](scripts/powershell/common/ps-account-firewall-create.md?toc=%2fpowershell%2fmodule%2ftoc.json)| Create an Azure Cosmos account with IP Firewall enabled. |
0 commit comments