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
+67-42Lines changed: 67 additions & 42 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 Powershell manage your Azure Cosmos accounts, databases,
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: sample
7
-
ms.date: 03/26/2020
7
+
ms.date: 04/29/2020
8
8
ms.author: mjbrown
9
9
ms.custom: seodec18
10
10
---
@@ -14,9 +14,7 @@ ms.custom: seodec18
14
14
The following guide describes how to use PowerShell to script and automate management of Azure Cosmos DB resources, including account, database, container, and throughput.
15
15
16
16
> [!NOTE]
17
-
> Samples in this article use `Get-AzResource` and `Set-AzResource` Powershell cmdlets for Azure resource operations as well as [Az.CosmosDB](https://docs.microsoft.com/powershell/module/az.cosmosdb) management cmdlets. `Az.CosmosDB` cmdlets are still in preview and may change before they are Generally Available. See the [Az.CosmosDB](https://docs.microsoft.com/powershell/module/az.cosmosdb) API reference page for any updates to the commands.
18
-
19
-
To view all of the properties that can be managed using `Get-Resource`/`Set-AzResource` PowerShell cmdlets, see [Azure Cosmos DB resource provider schema](/azure/templates/microsoft.documentdb/allversions)
17
+
> Samples in this article use [Az.CosmosDB](https://docs.microsoft.com/powershell/module/az.cosmosdb) management cmdlets. These cmdlets are still in preview and may change before they are Generally Available. See the [Az.CosmosDB](https://docs.microsoft.com/powershell/module/az.cosmosdb) API reference page for any updates to the commands.
20
18
21
19
For cross-platform management of Azure Cosmos DB, you can use the `Az` and `Az.CosmosDB` cmdlets with [cross-platform Powershell](https://docs.microsoft.com/powershell/scripting/install/installing-powershell), as well as the [Azure CLI](manage-with-cli.md), the [REST API][rp-rest-api], or the [Azure portal](create-sql-api-dotnet.md#create-account).
22
20
@@ -26,8 +24,6 @@ For cross-platform management of Azure Cosmos DB, you can use the `Az` and `Az.C
26
24
27
25
Follow the instructions in [How to install and configure Azure PowerShell][powershell-install-configure] to install and sign in to your Azure account in Powershell.
28
26
29
-
*`Set-AzureResource` is used below. It will ask for user confirmation. If you prefer to execute without requiring user confirmation, append the `-Force` flag to the command.
30
-
31
27
## Azure Cosmos accounts
32
28
33
29
The following sections demonstrate how to manage the Azure Cosmos account, including:
@@ -52,14 +48,17 @@ This command creates an Azure Cosmos DB database account with [multiple regions]
@@ -105,7 +104,7 @@ This command allows you to update your Azure Cosmos DB database account properti
105
104
* Enabling Multi-master
106
105
107
106
> [!NOTE]
108
-
> 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 from any other change to the account.
107
+
> 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 from any other change to the account.
109
108
> [!NOTE]
110
109
> 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).
111
110
@@ -114,37 +113,33 @@ This command allows you to update your Azure Cosmos DB database account properti
### <aid="create-container-lww"></a>Create an Azure Cosmos DB container with conflict resolution
570
567
571
-
To create a conflict resolution policy to use a stored procedure, set `"mode"="custom"` and set the resolution path as the name of the stored procedure, `"conflictResolutionPath"="myResolverStoredProcedure"`. To write all conflicts to the ConflictsFeed and handle separately, set `"mode"="custom"` and `"conflictResolutionPath"=""`
568
+
To write all conflicts to the ConflictsFeed and handle separately, pass `-Type "Custom" -Path ""`.
572
569
573
570
```azurepowershell-interactive
574
571
# Create container with last-writer-wins conflict resolution policy
To create a conflict resolution policy to use a stored procedure, call `New-AzCosmosDBSqlConflictResolutionPolicy` and pass parameters `-Type` and `-ConflictResolutionProcedure`.
594
+
595
+
```azurepowershell-interactive
596
+
# Create container with custom conflict resolution policy using a stored procedure
0 commit comments