Skip to content

Instantly share code, notes, and snippets.

@markjbrown
Last active January 30, 2024 20:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markjbrown/03d3640a2d915f5899b84e5927e4e589 to your computer and use it in GitHub Desktop.
Save markjbrown/03d3640a2d915f5899b84e5927e4e589 to your computer and use it in GitHub Desktop.
Create a Cosmos DB free-tier account and database with 400 RU
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"databaseAccount_free_tier_name": {
"defaultValue": "my-cosmos-account-name",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.DocumentDB/databaseAccounts",
"apiVersion": "2020-03-01",
"name": "[parameters('databaseAccount_free_tier_name')]",
"location": "West US",
"tags": {
"defaultExperience": "Core (SQL)",
"CosmosAccountType": "Non-Production"
},
"kind": "GlobalDocumentDB",
"properties": {
"enableFreeTier": true,
"publicNetworkAccess": "Enabled",
"enableAutomaticFailover": false,
"enableMultipleWriteLocations": false,
"isVirtualNetworkFilterEnabled": false,
"virtualNetworkRules": [],
"disableKeyBasedMetadataWriteAccess": false,
"databaseAccountOfferType": "Standard",
"consistencyPolicy": {
"defaultConsistencyLevel": "Session",
"maxIntervalInSeconds": 5,
"maxStalenessPrefix": 100
},
"locations": [
{
"locationName": "West US",
"provisioningState": "Succeeded",
"failoverPriority": 0,
"isZoneRedundant": false
}
],
"capabilities": []
}
},
{
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
"apiVersion": "2020-03-01",
"name": "[concat(parameters('databaseAccount_free_tier_name'), '/database1')]",
"dependsOn": [
"[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccount_free_tier_name'))]"
],
"properties": {
"resource": {
"id": "database1"
},
"options": {"throughput": 400}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment