Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"isUpdate": {
"type": "bool"
},
"throughput": {
"type": "int",
"minValue": 400,
"maxValue": 1000000
}
},
"variables": {
"databaseAccountName": "docsdbaccount",
"databaseName": "docsdb",
"docsCollectionName": "docs"
},
"resources": [
{
"apiVersion": "2015-04-08",
"kind": "GlobalDocumentDB",
"location": "[resourceGroup().location]",
"name": "[variables('databaseAccountName')]",
"properties": {
"name": "[variables('databaseAccountName')]",
"databaseAccountOfferType": "Standard",
"locations": [
{
"failoverPriority": 0,
"locationName": "[resourceGroup().location]"
}
]
},
"tags": {
"defaultExperience": "DocumentDB"
},
"type": "Microsoft.DocumentDB/databaseAccounts"
},
{
"type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
"name": "[concat(variables('databaseAccountName'), '/sql/', variables('databaseName'))]",
"apiVersion": "2016-03-31",
"dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('databaseAccountName'))]" ],
"properties": {
"resource": {
"id": "[variables('databaseName')]"
},
"options": {
"throughput": "[if(parameters('isUpdate'), json('null'), parameters('throughput'))]"
}
},
"resources": [
{
"type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/settings",
"name": "[concat(variables('databaseAccountName'), '/sql/', variables('databaseName'), '/throughput')]",
"apiVersion": "2016-03-31",
"dependsOn": [
"[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('databaseAccountName'), 'sql', variables('databaseName'))]"
],
"properties": {
"resource": {
"throughput": "[parameters('throughput')]"
}
}
},
{
"type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
"name": "[concat(variables('databaseAccountName'), '/sql/', variables('databaseName'), '/', variables('docsCollectionName'))]",
"apiVersion": "2016-03-31",
"dependsOn": [
"[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('databaseAccountName'), 'sql', variables('databaseName'))]"
],
"properties": {
"resource": {
"id": "[variables('docsCollectionName')]"
}
}
}
]
}
],
"outputs": { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.