Microsoft.DocumentDB databaseAccounts/apis/databases/containers 2016-03-31

The databaseAccounts/apis/databases/containers resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.DocumentDB/databaseAccounts/apis/databases/containers resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/apis/databases/containers@2016-03-31' = {
  name: 'string'
  properties: {
    options: {}
    resource: {
      conflictResolutionPolicy: {
        conflictResolutionPath: 'string'
        conflictResolutionProcedure: 'string'
        mode: 'string'
      }
      defaultTtl: int
      id: 'string'
      indexingPolicy: {
        automatic: bool
        excludedPaths: [
          {
            path: 'string'
          }
        ]
        includedPaths: [
          {
            indexes: [
              {
                dataType: 'string'
                kind: 'string'
                precision: int
              }
            ]
            path: 'string'
          }
        ]
        indexingMode: 'string'
      }
      partitionKey: {
        kind: 'string'
        paths: [ 'string' ]
      }
      uniqueKeyPolicy: {
        uniqueKeys: [
          {
            paths: [ 'string' ]
          }
        ]
      }
    }
  }
}

Property values

databaseAccounts/apis/databases/containers

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.DocumentDB/databaseAccounts/apis/databases/containers'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2016-03-31'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
properties The properties of an Azure Cosmos DB container SqlContainerCreateUpdateProperties (required)

SqlContainerCreateUpdateProperties

Name Description Value
options object (required)
resource SqlContainerResource (required)

SqlContainerResource

Name Description Value
conflictResolutionPolicy ConflictResolutionPolicy
defaultTtl int
id string (required)
indexingPolicy IndexingPolicy
partitionKey ContainerPartitionKey
uniqueKeyPolicy UniqueKeyPolicy

ConflictResolutionPolicy

Name Description Value
conflictResolutionPath string
conflictResolutionProcedure string
mode 'Custom'
'LastWriterWins'

IndexingPolicy

Name Description Value
automatic bool
excludedPaths ExcludedPath[]
includedPaths IncludedPath[]
indexingMode 'Consistent'
'Lazy'
'None'

ExcludedPath

Name Description Value
path string

IncludedPath

Name Description Value
indexes Indexes[]
path string

Indexes

Name Description Value
dataType 'LineString'
'MultiPolygon'
'Number'
'Point'
'Polygon'
'String'
kind 'Hash'
'Range'
'Spatial'
precision int

ContainerPartitionKey

Name Description Value
kind 'Hash'
'Range'
paths string[]

UniqueKeyPolicy

Name Description Value
uniqueKeys UniqueKey[]

UniqueKey

Name Description Value
paths string[]

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create Azure Cosmos with SQL API and multiple containers

Deploy to Azure
The template creates a Cosmos container with a SQL API and allows adding mulitple containers.