@@ -4,7 +4,7 @@ description: Use Azure Resource Manager templates to create and configure Azure
4
4
author : markjbrown
5
5
ms.service : cosmos-db
6
6
ms.topic : conceptual
7
- ms.date : 04/30 /2020
7
+ ms.date : 05/12 /2020
8
8
ms.author : mjbrown
9
9
---
10
10
@@ -26,11 +26,217 @@ To create any of the Azure Cosmos DB resources below, copy the following example
26
26
27
27
## Azure Cosmos account for Cassandra with autoscale provisioned throughput
28
28
29
- This template creates an Azure Cosmos account in two regions with options for consistency and failover, with a keyspace and table configured for autoscale throughput. This template is also available for one-click deploy from Azure Quickstart Templates Gallery.
29
+ This template creates an Azure Cosmos account in two regions with options for consistency and failover, with a keyspace and table configured for autoscale throughput.
30
30
31
- [ ![ Deploy to Azure] ( https://aka.ms/deploytoazurebutton )] ( https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-cosmosdb-cassandra-autosscale%2Fazuredeploy.json )
31
+ ``` json
32
+ {
33
+ "$schema" : " https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" ,
34
+ "contentVersion" : " 1.0.0.0" ,
35
+ "parameters" : {
36
+ "accountName" : {
37
+ "type" : " string" ,
38
+ "defaultValue" : " [concat('cassandra-', uniqueString(resourceGroup().id))]" ,
39
+ "metadata" : {
40
+ "description" : " Cosmos DB account name, max length 44 characters"
41
+ }
42
+ },
43
+ "location" : {
44
+ "type" : " string" ,
45
+ "defaultValue" : " [resourceGroup().location]" ,
46
+ "metadata" : {
47
+ "description" : " Location for the Cosmos DB account."
48
+ }
49
+ },
50
+ "primaryRegion" :{
51
+ "type" :" string" ,
52
+ "metadata" : {
53
+ "description" : " The primary replica region for the Cosmos DB account."
54
+ }
55
+ },
56
+ "secondaryRegion" :{
57
+ "type" :" string" ,
58
+ "metadata" : {
59
+ "description" : " The secondary replica region for the Cosmos DB account."
60
+ }
61
+ },
62
+ "defaultConsistencyLevel" : {
63
+ "type" : " string" ,
64
+ "defaultValue" : " Session" ,
65
+ "allowedValues" : [ " Eventual" , " ConsistentPrefix" , " Session" , " BoundedStaleness" , " Strong" ],
66
+ "metadata" : {
67
+ "description" : " The default consistency level of the Cosmos DB account."
68
+ }
69
+ },
70
+ "maxStalenessPrefix" : {
71
+ "type" : " int" ,
72
+ "defaultValue" : 100000 ,
73
+ "minValue" : 10 ,
74
+ "maxValue" : 1000000 ,
75
+ "metadata" : {
76
+ "description" : " Max stale requests. Required for BoundedStaleness. Valid ranges, Single Region: 10 to 1000000. Multi Region: 100000 to 1000000."
77
+ }
78
+ },
79
+ "maxIntervalInSeconds" : {
80
+ "type" : " int" ,
81
+ "defaultValue" : 300 ,
82
+ "minValue" : 5 ,
83
+ "maxValue" : 86400 ,
84
+ "metadata" : {
85
+ "description" : " Max lag time (seconds). Required for BoundedStaleness. Valid ranges, Single Region: 5 to 84600. Multi Region: 300 to 86400."
86
+ }
87
+ },
88
+ "automaticFailover" : {
89
+ "type" : " bool" ,
90
+ "defaultValue" : true ,
91
+ "allowedValues" : [ true , false ],
92
+ "metadata" : {
93
+ "description" : " Enable automatic failover for regions"
94
+ }
95
+ },
96
+ "keyspaceName" : {
97
+ "type" : " string" ,
98
+ "metadata" : {
99
+ "description" : " The name for the Cassandra Keyspace"
100
+ }
101
+ },
102
+ "tableName" : {
103
+ "type" : " string" ,
104
+ "metadata" : {
105
+ "description" : " The name for the Cassandra table"
106
+ }
107
+ },
108
+ "throughputPolicy" :{
109
+ "type" : " string" ,
110
+ "defaultValue" : " Autoscale" ,
111
+ "allowedValues" : [ " Manual" , " Autoscale" ],
112
+ "metadata" : {
113
+ "description" : " The throughput policy for the Cassandra table"
114
+ }
115
+ },
116
+ "manualProvisionedThroughput" : {
117
+ "type" : " int" ,
118
+ "defaultValue" : 400 ,
119
+ "minValue" : 400 ,
120
+ "maxValue" : 1000000 ,
121
+ "metadata" : {
122
+ "description" : " Throughput value when using Provisioned Throughput Policy for the Cassandra table"
123
+ }
124
+ },
125
+ "autoscaleMaxThroughput" : {
126
+ "type" : " int" ,
127
+ "defaultValue" : 4000 ,
128
+ "minValue" : 4000 ,
129
+ "maxValue" : 1000000 ,
130
+ "metadata" : {
131
+ "description" : " Maximum throughput when using Autoscale Throughput Policy for the Cassandra table"
132
+ }
133
+ }
134
+ },
135
+ "variables" : {
136
+ "accountName" : " [toLower(parameters('accountName'))]" ,
137
+ "consistencyPolicy" : {
138
+ "Eventual" : {
139
+ "defaultConsistencyLevel" : " Eventual"
140
+ },
141
+ "ConsistentPrefix" : {
142
+ "defaultConsistencyLevel" : " ConsistentPrefix"
143
+ },
144
+ "Session" : {
145
+ "defaultConsistencyLevel" : " Session"
146
+ },
147
+ "BoundedStaleness" : {
148
+ "defaultConsistencyLevel" : " BoundedStaleness" ,
149
+ "maxStalenessPrefix" : " [parameters('maxStalenessPrefix')]" ,
150
+ "maxIntervalInSeconds" : " [parameters('maxIntervalInSeconds')]"
151
+ },
152
+ "Strong" : {
153
+ "defaultConsistencyLevel" : " Strong"
154
+ }
155
+ },
156
+ "locations" :
157
+ [
158
+ {
159
+ "locationName" : " [parameters('primaryRegion')]" ,
160
+ "failoverPriority" : 0 ,
161
+ "isZoneRedundant" : false
162
+ },
163
+ {
164
+ "locationName" : " [parameters('secondaryRegion')]" ,
165
+ "failoverPriority" : 1 ,
166
+ "isZoneRedundant" : false
167
+ }
168
+ ],
169
+ "throughputPolicy" : {
170
+ "Manual" : {
171
+ "throughput" : " [parameters('manualProvisionedThroughput')]"
172
+ },
173
+ "Autoscale" : {
174
+ "autoscaleSettings" : { "maxThroughput" : " [parameters('autoscaleMaxThroughput')]" }
175
+ }
176
+ },
177
+ "throughputPolicyToUse" : " [if(equals(parameters('throughputPolicy'), 'Manual'), variables('throughputPolicy').Manual, variables('throughputPolicy').Autoscale)]"
178
+ },
179
+ "resources" :
180
+ [
181
+ {
182
+ "type" : " Microsoft.DocumentDB/databaseAccounts" ,
183
+ "name" : " [variables('accountName')]" ,
184
+ "apiVersion" : " 2020-04-01" ,
185
+ "location" : " [parameters('location')]" ,
186
+ "kind" : " GlobalDocumentDB" ,
187
+ "properties" : {
188
+ "capabilities" : [{ "name" : " EnableCassandra" }],
189
+ "consistencyPolicy" : " [variables('consistencyPolicy')[parameters('defaultConsistencyLevel')]]" ,
190
+ "locations" : " [variables('locations')]" ,
191
+ "databaseAccountOfferType" : " Standard" ,
192
+ "enableAutomaticFailover" : " [parameters('automaticFailover')]"
193
+ }
194
+ },
195
+ {
196
+ "type" : " Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces" ,
197
+ "name" : " [concat(variables('accountName'), '/', parameters('keyspaceName'))]" ,
198
+ "apiVersion" : " 2020-04-01" ,
199
+ "dependsOn" : [ " [resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('accountName'))]" ],
200
+ "properties" :{
201
+ "resource" :{
202
+ "id" : " [parameters('keyspaceName')]"
203
+ }
204
+ }
205
+ },
206
+ {
207
+ "type" : " Microsoft.DocumentDb/databaseAccounts/cassandraKeyspaces/tables" ,
208
+ "name" : " [concat(variables('accountName'), '/', parameters('keyspaceName'), '/', parameters('tableName'))]" ,
209
+ "apiVersion" : " 2020-04-01" ,
210
+ "dependsOn" : [ " [resourceId('Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces', variables('accountName'), parameters('keyspaceName'))]" ],
211
+ "properties" :
212
+ {
213
+ "resource" :{
214
+ "id" : " [parameters('tableName')]" ,
215
+ "schema" : {
216
+ "columns" : [
217
+ { "name" : " loadid" , "type" : " uuid" },
218
+ { "name" : " machine" , "type" : " uuid" },
219
+ { "name" : " cpu" , "type" : " int" },
220
+ { "name" : " mtime" , "type" : " int" },
221
+ { "name" : " load" , "type" : " float" }
222
+ ],
223
+ "partitionKeys" : [
224
+ { "name" : " machine" },
225
+ { "name" : " cpu" },
226
+ { "name" : " mtime" }
227
+ ],
228
+ "clusterKeys" : [
229
+ { "name" : " loadid" , "orderBy" : " asc" }
230
+ ]
231
+ }
232
+ },
233
+ "options" : " [variables('throughputPolicyToUse')]"
234
+ }
235
+ }
236
+ ]
237
+ }
32
238
33
- :::code language="json" source=" ~ /quickstart-templates/101-cosmosdb-cassandra-autoscale/azuredeploy.json":::
239
+ ```
34
240
35
241
<a id =" create-manual " ></a >
36
242
0 commit comments