Microsoft.DocumentDB databaseAccounts/sqlDatabases/containers 2019-12-12

Template format

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

{
  "name": "string",
  "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers",
  "apiVersion": "2019-12-12",
  "location": "string",
  "tags": {},
  "properties": {
    "resource": {
      "id": "string",
      "indexingPolicy": {
        "automatic": "boolean",
        "indexingMode": "string",
        "includedPaths": [
          {
            "path": "string",
            "indexes": [
              {
                "dataType": "string",
                "precision": "integer",
                "kind": "string"
              }
            ]
          }
        ],
        "excludedPaths": [
          {
            "path": "string"
          }
        ],
        "spatialIndexes": [
          {
            "path": "string",
            "types": [
              "string"
            ]
          }
        ]
      },
      "partitionKey": {
        "paths": [
          "string"
        ],
        "kind": "string",
        "version": "integer"
      },
      "defaultTtl": "integer",
      "uniqueKeyPolicy": {
        "uniqueKeys": [
          {
            "paths": [
              "string"
            ]
          }
        ]
      },
      "conflictResolutionPolicy": {
        "mode": "string",
        "conflictResolutionPath": "string",
        "conflictResolutionProcedure": "string"
      }
    },
    "options": {
      "additionalProperties": {},
      "throughput": "string"
    }
  },
  "resources": []
}

Property values

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

Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers object

Name Type Required Value
name string Yes Cosmos DB container name.
type enum Yes containers
-or-
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers

See Set name and type for child resources.
apiVersion enum Yes 2019-12-12
location string No The location of the resource group to which the resource belongs.
tags object No
properties object Yes Properties to create and update Azure Cosmos DB container. - SqlContainerCreateUpdateProperties object
resources array No triggers userDefinedFunctions storedProcedures

SqlContainerCreateUpdateProperties object

Name Type Required Value
resource object Yes The standard JSON format of a container - SqlContainerResource object
options object Yes A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - CreateUpdateOptions object

SqlContainerResource object

Name Type Required Value
id string Yes Name of the Cosmos DB SQL container
indexingPolicy object No The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container - IndexingPolicy object
partitionKey object No The configuration of the partition key to be used for partitioning data into multiple partitions - ContainerPartitionKey object
defaultTtl integer No Default time to live
uniqueKeyPolicy object No The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. - UniqueKeyPolicy object
conflictResolutionPolicy object No The conflict resolution policy for the container. - ConflictResolutionPolicy object

CreateUpdateOptions object

Name Type Required Value
additionalProperties object No Unmatched properties from the message are deserialized this collection
throughput string No Request Units per second. For example, "throughput": "10000".

IndexingPolicy object

Name Type Required Value
automatic boolean No Indicates if the indexing policy is automatic
indexingMode enum No Indicates the indexing mode. - Consistent, Lazy, None
includedPaths array No List of paths to include in the indexing - IncludedPath object
excludedPaths array No List of paths to exclude from indexing - ExcludedPath object
spatialIndexes array No List of spatial specifics - SpatialSpec object

ContainerPartitionKey object

Name Type Required Value
paths array No List of paths using which data within the container can be partitioned - string
kind enum No Indicates the kind of algorithm used for partitioning. - Hash or Range
version integer No Indicates the version of the partition key definition

UniqueKeyPolicy object

Name Type Required Value
uniqueKeys array No List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. - UniqueKey object

ConflictResolutionPolicy object

Name Type Required Value
mode enum No Indicates the conflict resolution mode. - LastWriterWins or Custom
conflictResolutionPath string No The conflict resolution path in the case of LastWriterWins mode.
conflictResolutionProcedure string No The procedure to resolve conflicts in the case of custom mode.

IncludedPath object

Name Type Required Value
path string No The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
indexes array No List of indexes for this path - Indexes object

ExcludedPath object

Name Type Required Value
path string No The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)

SpatialSpec object

Name Type Required Value
path string No The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
types array No List of path's spatial type - Point, LineString, Polygon, MultiPolygon

UniqueKey object

Name Type Required Value
paths array No List of paths must be unique for each document in the Azure Cosmos DB service - string

Indexes object

Name Type Required Value
dataType enum No The datatype for which the indexing behavior is applied to. - String, Number, Point, Polygon, LineString, MultiPolygon
precision integer No The precision of the index. -1 is maximum precision.
kind enum No Indicates the type of index. - Hash, Range, Spatial

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create an Azure Cosmos account for Core (SQL) API

Deploy to Azure
This template creates an Azure Cosmos account for Core (SQL) API with a database and container with throughput with multiple other options.
Azure Cosmos DB account SQL API with analytical store

Deploy to Azure
This template creates an Azure Cosmos account for Core (SQL) API with a database and container configured with autoscale and analytical store.
Create an Azure Cosmos DB account SQL API with autoscale

Deploy to Azure
This template creates an Azure Cosmos account for Core (SQL) API with a database and container with autoscale throughput with multiple other options.
Create Azure Cosmos Core (SQL) API stored procedures

Deploy to Azure
This template creates an Azure Cosmos account for Core (SQL) API and a container with a stored procedure, trigger and user defined function.