Microsoft.DocumentDB/databaseAccounts template reference

API Version: 2015-04-08

Template format

To create a Microsoft.DocumentDB/databaseAccounts resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.DocumentDB/databaseAccounts",
  "apiVersion": "2015-04-08",
  "location": "string",
  "tags": {},
  "kind": "string",
  "properties": {
    "consistencyPolicy": {
      "defaultConsistencyLevel": "string",
      "maxStalenessPrefix": "integer",
      "maxIntervalInSeconds": "integer"
    },
    "locations": [
      {
        "locationName": "string",
        "failoverPriority": "integer"
      }
    ],
    "databaseAccountOfferType": "Standard",
    "ipRangeFilter": "string",
    "enableAutomaticFailover": boolean
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.DocumentDB/databaseAccounts object

Name Type Required Value
name string Yes DocumentDB database account name.
type enum Yes Microsoft.DocumentDB/databaseAccounts
apiVersion enum Yes 2015-04-08
location string Yes The location of the resource group to which the resource belongs.
tags object No
kind enum No Indicates the type of database account. This can only be set at database account creation. - GlobalDocumentDB, MongoDB, Parse
properties object Yes DatabaseAccountCreateUpdateProperties object

DatabaseAccountCreateUpdateProperties object

Name Type Required Value
consistencyPolicy object No The consistency policy for the DocumentDB account. - ConsistencyPolicy object
locations array Yes An array that contains the georeplication locations enabled for the DocumentDB account. - Location object
databaseAccountOfferType enum Yes Standard
ipRangeFilter string No DocumentDB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.
enableAutomaticFailover boolean No Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.

ConsistencyPolicy object

Name Type Required Value
defaultConsistencyLevel enum Yes The default consistency level and configuration settings of the DocumentDB account. - Eventual, Session, BoundedStaleness, Strong, ConsistentPrefix
maxStalenessPrefix integer No When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
maxIntervalInSeconds integer No When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 1 - 100. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

Location object

Name Type Required Value
locationName string No The name of the region.
failoverPriority integer No The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.

Quickstart templates

For example templates, see DocumentDB templates.