Skip to content

Commit 99a2c14

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into freshness_c50
2 parents bc07c5e + 76cc3cb commit 99a2c14

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

articles/cosmos-db/how-to-manage-consistency.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Manage consistency in Azure Cosmos DB
3-
description: Learn how to configure and manage consistency levels in Azure Cosmos DB using Azure portal, .Net SDK, Java SDK and various other SDKs
3+
description: Learn how to configure and manage consistency levels in Azure Cosmos DB using Azure portal, .NET SDK, Java SDK and various other SDKs
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 12/02/2019
7+
ms.date: 04/24/2020
88
ms.author: mjbrown
99
---
1010

@@ -16,42 +16,32 @@ This article explains how to manage consistency levels in Azure Cosmos DB. You l
1616

1717
## Configure the default consistency level
1818

19-
The [default consistency level](consistency-levels.md) is the consistency level that clients use by default. Clients can always override it.
19+
The [default consistency level](consistency-levels.md) is the consistency level that clients use by default.
2020

2121
### CLI
2222

23+
Create a Cosmos account with Session consistency, then update the default consistency.
24+
2325
```azurecli
24-
# create with a default consistency
25-
az cosmosdb create --name <name of Cosmos DB Account> --resource-group <resource group name> --default-consistency-level Session
26+
# Create a new account with Session consistency
27+
az cosmosdb create --name $accountName --resource-group $resourceGroupName --default-consistency-level Session
2628
2729
# update an existing account's default consistency
28-
az cosmosdb update --name <name of Cosmos DB Account> --resource-group <resource group name> --default-consistency-level Eventual
30+
az cosmosdb update --name $accountName --resource-group $resourceGroupName --default-consistency-level Strong
2931
```
3032

3133
### PowerShell
3234

33-
This example creates a new Azure Cosmos account with multiple write regions enabled, in East US and West US regions. The default consistency level is set to *Session* consistency.
35+
Create a Cosmos account with Session consistency, then update the default consistency.
3436

3537
```azurepowershell-interactive
36-
$locations = @(@{"locationName"="East US"; "failoverPriority"=0},
37-
@{"locationName"="West US"; "failoverPriority"=1})
38-
39-
$iprangefilter = ""
40-
41-
$consistencyPolicy = @{"defaultConsistencyLevel"="Session"}
38+
# Create a new account with Session consistency
39+
New-AzCosmosDBAccount -ResourceGroupName $resourceGroupName `
40+
-Location $locations -Name $accountName -DefaultConsistencyLevel "Session"
4241
43-
$CosmosDBProperties = @{"databaseAccountOfferType"="Standard";
44-
"locations"=$locations;
45-
"consistencyPolicy"=$consistencyPolicy;
46-
"ipRangeFilter"=$iprangefilter;
47-
"enableMultipleWriteLocations"="true"}
48-
49-
New-AzResource -ResourceType "Microsoft.DocumentDb/databaseAccounts" `
50-
-ApiVersion "2015-04-08" `
51-
-ResourceGroupName "myResourceGroup" `
52-
-Location "East US" `
53-
-Name "myCosmosDbAccount" `
54-
-Properties $CosmosDBProperties
42+
# Update an existing account's default consistency
43+
Update-AzCosmosDBAccount -ResourceGroupName $resourceGroupName `
44+
-Name $accountName -DefaultConsistencyLevel "Strong"
5545
```
5646

5747
### Azure portal
@@ -62,8 +52,10 @@ To view or modify the default consistency level, sign in to the Azure portal. Fi
6252

6353
## Override the default consistency level
6454

65-
Clients can override the default consistency level that is set by the service.
66-
Consistency level can be set on a per request, which overrides the default consistency level set at the account level.
55+
Clients can override the default consistency level that is set by the service. Consistency level can be set on a per request, which overrides the default consistency level set at the account level.
56+
57+
> [!TIP]
58+
> Consistency can only be **relaxed** at the request level. To move from weaker to stronger consistency, update the default consistency for the Cosmos account.
6759
6860
### <a id="override-default-consistency-dotnet"></a>.NET SDK V2
6961

@@ -85,8 +77,8 @@ ItemRequestOptions requestOptions = new ItemRequestOptions { ConsistencyLevel =
8577

8678
var response = await client.GetContainer(databaseName, containerName)
8779
.CreateItemAsync(
88-
item,
89-
new PartitionKey(itemPartitionKey),
80+
item,
81+
new PartitionKey(itemPartitionKey),
9082
requestOptions);
9183
```
9284

@@ -231,7 +223,6 @@ How eventual is eventual consistency? For the average case, can we offer stalene
231223

232224
![PBS graph in the Azure portal](./media/how-to-manage-consistency/pbs-metric.png)
233225

234-
235226
## Next steps
236227

237228
Learn more about how to manage data conflicts, or move on to the next key concept in Azure Cosmos DB. See the following articles:

articles/machine-learning/concept-enterprise-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The following table lists some of the major Azure Machine Learning operations an
7373
If the built-in roles don't meet your needs, you can create custom roles. Custom roles are supported only for operations on the workspace and Machine Learning Compute. Custom roles can have read, write, or delete permissions on the workspace and on the compute resource in that workspace. You can make the role available at a specific workspace level, a specific resource-group level, or a specific subscription level. For more information, see [Manage users and roles in an Azure Machine Learning workspace](how-to-assign-roles.md).
7474

7575
> [!WARNING]
76-
> Azure Machine Learning is not currently supported with Azure Active Directory business-to-business collaboration.
76+
> Azure Machine Learning is supported with Azure Active Directory business-to-business collaboration, but is not currently supported with Azure Active Directory business-to-consumer collaboration.
7777
7878
### Securing compute targets and data
7979

0 commit comments

Comments
 (0)