Skip to content

Commit 2b51a5f

Browse files
authored
Merge pull request #84299 from markjbrown/mjbrown
Update ARM, CLI, PS for account name length limit
2 parents 1405b90 + ca7c0cf commit 2b51a5f

8 files changed

+47
-17
lines changed

articles/cosmos-db/how-to-manage-database-account.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This article describes how to manage various tasks on an Azure Cosmos account us
2323
```azurecli-interactive
2424
# Create an account
2525
$resourceGroupName = 'myResourceGroup'
26-
$accountName = 'myaccountname' # must be lower case.
26+
$accountName = 'myaccountname' # must be lower case and < 31 characters
2727
2828
az cosmosdb create \
2929
--name $accountName \
@@ -40,7 +40,7 @@ az cosmosdb create \
4040
# Create an Azure Cosmos account for Core (SQL) API
4141
$resourceGroupName = "myResourceGroup"
4242
$location = "West US"
43-
$accountName = "mycosmosaccount" # must be lower case.
43+
$accountName = "mycosmosaccount" # must be lower case and < 31 characters
4444
4545
$locations = @(
4646
@{ "locationName"="West US"; "failoverPriority"=0 },
@@ -93,7 +93,7 @@ In a multi-region write mode, you can add or remove any region, if you have at l
9393

9494
```azurecli-interactive
9595
$resourceGroupName = 'myResourceGroup'
96-
$accountName = 'myaccountname'
96+
$accountName = 'myaccountname' # must be lower case and <31 characters
9797
9898
# Create an account with 1 region
9999
az cosmosdb create --name $accountName --resource-group $resourceGroupName --locations regionName=westus failoverPriority=0 isZoneRedundant=False
@@ -111,7 +111,7 @@ az cosmosdb update --name $accountName --resource-group $resourceGroupName --loc
111111
# Create an account with 1 region
112112
$resourceGroupName = "myResourceGroup"
113113
$location = "West US"
114-
$accountName = "mycosmosaccount" # must be lower case.
114+
$accountName = "mycosmosaccount" # must be lower case and <31 characters
115115
116116
$locations = @( @{ "locationName"="West US"; "failoverPriority"=0 } )
117117
$consistencyPolicy = @{ "defaultConsistencyLevel"="Session" }
@@ -196,7 +196,7 @@ Set-AzResource -ResourceType "Microsoft.DocumentDb/databaseAccounts" `
196196

197197
### <a id="configure-multiple-write-regions-arm"></a>Resource Manager template
198198

199-
An account can be migrated from single-master to multi-master by deploying the Resource Manager template used to create the account and setting `enableMultipleWriteLocations: true`. The following Azure Resource Manager template is a bare minimum template that will deploy an Azure Cosmos account for SQL API with a single region and multi-master enabled.
199+
An account can be migrated from single-master to multi-master by deploying the Resource Manager template used to create the account and setting `enableMultipleWriteLocations: true`. The following Azure Resource Manager template is a bare minimum template that will deploy an Azure Cosmos account for SQL API with two regions and multiple write locations enabled.
200200

201201
```json
202202
{
@@ -209,6 +209,18 @@ An account can be migrated from single-master to multi-master by deploying the R
209209
"location": {
210210
"type": "String",
211211
"defaultValue": "[resourceGroup().location]"
212+
},
213+
"primaryRegion":{
214+
"type":"string",
215+
"metadata": {
216+
"description": "The primary replica region for the Cosmos DB account."
217+
}
218+
},
219+
"secondaryRegion":{
220+
"type":"string",
221+
"metadata": {
222+
"description": "The secondary replica region for the Cosmos DB account."
223+
}
212224
}
213225
},
214226
"resources": [
@@ -222,10 +234,15 @@ An account can be migrated from single-master to multi-master by deploying the R
222234
"properties": {
223235
"databaseAccountOfferType": "Standard",
224236
"consistencyPolicy": { "defaultConsistencyLevel": "Session" },
225-
"locations": [
237+
"locations":
238+
[
226239
{
227-
"locationName": "[parameters('location')]",
240+
"locationName": "[parameters('primaryRegion')]",
228241
"failoverPriority": 0
242+
},
243+
{
244+
"locationName": "[parameters('secondaryRegion')]",
245+
"failoverPriority": 1
229246
}
230247
],
231248
"enableMultipleWriteLocations": true

articles/cosmos-db/manage-cassandra-with-resource-manager.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 05/06/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
---
1010

@@ -14,6 +14,9 @@ ms.author: mjbrown
1414

1515
Create Azure Cosmos DB resources using an Azure Resource Manager template. This template will create an Azure Cosmos account for Cassandra API with two tables that share 400 RU/s throughput at the keyspace-level. Copy the template and deploy as shown below or visit [Azure Quickstart Gallery](https://azure.microsoft.com/resources/templates/101-cosmosdb-cassandra/) and deploy from the Azure portal. You can also download the template to your local computer or create a new template and specify the local path with the `--template-file` parameter.
1616

17+
> [!NOTE]
18+
> Account names must be lower case and < 31 characters.
19+
1720
[!code-json[create-cosmos-Cassandra](~/quickstart-templates/101-cosmosdb-cassandra/azuredeploy.json)]
1821

1922
## Deploy with Azure CLI
@@ -92,4 +95,4 @@ Here are some additional resources:
9295
- [Azure Resource Manager documentation](/azure/azure-resource-manager/)
9396
- [Azure Cosmos DB resource provider schema](/azure/templates/microsoft.documentdb/allversions)
9497
- [Azure Cosmos DB Quickstart templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.DocumentDB&pageNumber=1&sort=Popular)
95-
- [Troubleshoot common Azure Resource Manager deployment errors](../azure-resource-manager/resource-manager-common-deployment-errors.md)
98+
- [Troubleshoot common Azure Resource Manager deployment errors](../azure-resource-manager/resource-manager-common-deployment-errors.md)

articles/cosmos-db/manage-gremlin-with-resource-manager.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 05/20/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
---
1010

@@ -14,6 +14,9 @@ ms.author: mjbrown
1414

1515
Create Azure Cosmos DB resources using an Azure Resource Manager template. This template will create an Azure Cosmos account for Gremlin API with two graphs that share 400 RU/s throughput at the database level. Copy the template and deploy as shown below or visit [Azure Quickstart Gallery](https://azure.microsoft.com/resources/templates/101-cosmosdb-gremlin/) and deploy from the Azure portal. You can also download the template to your local computer or create a new template and specify the local path with the `--template-file` parameter.
1616

17+
> [!NOTE]
18+
> Account names must be lower case and < 31 characters.
19+
1720
[!code-json[create-cosmos-gremlin](~/quickstart-templates/101-cosmosdb-gremlin/azuredeploy.json)]
1821

1922
## Deploy with Azure CLI

articles/cosmos-db/manage-mongodb-with-resource-manager.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 05/20/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
---
1010

@@ -14,6 +14,9 @@ ms.author: mjbrown
1414

1515
Create Azure Cosmos DB resources using an Azure Resource Manager template. This template will create an Azure Cosmos account for MongoDB API with two collections that share 400 RU/s throughput at the database level. Copy the template and deploy as shown below or visit [Azure Quickstart Gallery](https://azure.microsoft.com/resources/templates/101-cosmosdb-mongodb/) and deploy from the Azure portal. You can also download the template to your local computer or create a new template and specify the local path with the `--template-file` parameter.
1616

17+
> [!NOTE]
18+
> Account names must be lower case and < 31 characters.
19+
1720
[!code-json[create-cosmos-mongo](~/quickstart-templates/101-cosmosdb-mongodb/azuredeploy.json)]
1821

1922
### Deploy via Azure CLI

articles/cosmos-db/manage-sql-with-resource-manager.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 07/25/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
---
1010

@@ -18,6 +18,7 @@ Create Azure Cosmos DB resources using an Azure Resource Manager template. This
1818
>
1919
> - Currently you cannot deploy User Defined Functions(UDFs), stored procedures, and triggers by using Resource Manager templates.
2020
> - You cannot simultaneously add or remove locations to an Azure Cosmos account and modify other properties. These must be done as separate operations.
21+
> - Account names must be lower case and < 31 characters.
2122
2223
[!code-json[create-cosmosdb-sql](~/quickstart-templates/101-cosmosdb-sql/azuredeploy.json)]
2324

articles/cosmos-db/manage-table-with-resource-manager.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 05/20/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
---
1010

@@ -14,6 +14,9 @@ ms.author: mjbrown
1414

1515
Create Azure Cosmos DB resources using an Azure Resource Manager template. This template will create an Azure Cosmos account for Table API with one table at 400 RU/s throughput. Copy the template and deploy as shown below or visit [Azure Quickstart Gallery](https://azure.microsoft.com/resources/templates/101-cosmosdb-table/) and deploy from the Azure portal. You can also download the template to your local computer or create a new template and specify the local path with the `--template-file` parameter.
1616

17+
> [!NOTE]
18+
> Account names must be lower case and < 31 characters.
19+
1720
[!code-json[create-cosmos-table](~/quickstart-templates/101-cosmosdb-table/azuredeploy.json)]
1821

1922
### Deploy via PowerShell

articles/cosmos-db/manage-with-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure CLI to manage your Azure Cosmos DB account, database and
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 05/23/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99

1010
---
@@ -22,7 +22,7 @@ To create an Azure Cosmos DB account with SQL API, Session consistency in East U
2222

2323
```azurecli-interactive
2424
az cosmosdb create \
25-
--name mycosmosdbaccount \
25+
--name mycosmosdbaccount # must be lowercase and < 31 characters \
2626
--resource-group myResourceGroup \
2727
--kind GlobalDocumentDB \
2828
--default-consistency-level Session \

articles/cosmos-db/manage-with-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Powershell manage your Azure Cosmos DB accounts, database
44
author: markjbrown
55
ms.service: cosmos-db
66
ms.topic: sample
7-
ms.date: 07/09/2019
7+
ms.date: 08/05/2019
88
ms.author: mjbrown
99
ms.custom: seodec18
1010
---
@@ -47,7 +47,7 @@ This command creates an Azure Cosmos DB database account with [multiple-regions]
4747
# Create an Azure Cosmos Account for Core (SQL) API
4848
$resourceGroupName = "myResourceGroup"
4949
$location = "West US 2"
50-
$accountName = "mycosmosaccount" # must be lower case.
50+
$accountName = "mycosmosaccount" # must be lowercase and < 31 characters .
5151
5252
$locations = @(
5353
@{ "locationName"="West US 2"; "failoverPriority"=0 },

0 commit comments

Comments
 (0)