The following tables describe the values you need to set in the schema.
Microsoft.DocumentDB/databaseAccounts object
Note
In Bicep, type and apiVersion are specified in the first line of the resource declaration. Use the format <type>@<apiVersion>. Don't set those properties in the resource body.
Name
Type
Required
Value
name
string
Yes
Cosmos DB database account name.
type
enum
Yes
For JSON - Microsoft.DocumentDB/databaseAccounts
apiVersion
enum
Yes
For JSON - 2021-03-01-preview
location
string
No
The location of the resource group to which the resource belongs.
tags
object
No
Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. - SystemAssigned, UserAssigned, SystemAssigned,UserAssigned, None
userAssignedIdentities
object
No
The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
Flag to indicate whether to enable/disable Virtual Network ACL rules.
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.
The default consistency level and configuration settings of the Cosmos DB 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 5 - 86400. 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.
isZoneRedundant
boolean
No
Flag to indicate whether or not this region is an AvailabilityZone region
IpAddressOrRange object
Name
Type
Required
Value
ipAddressOrRange
string
No
A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”.
Capability object
Name
Type
Required
Value
name
string
No
Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin".
VirtualNetworkRule object
Name
Type
Required
Value
id
string
No
Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
ignoreMissingVNetServiceEndpoint
boolean
No
Create firewall rule before the virtual network has vnet service endpoint enabled.
ApiProperties object
Name
Type
Required
Value
serverVersion
enum
No
Describes the ServerVersion of an a MongoDB account. - 3.2, 3.6, 4.0
BackupPolicy object
Name
Type
Required
Value
type
string
Yes
Describes the mode of backups. - Periodic, Continuous
An integer representing the interval in minutes between two backups
backupRetentionIntervalInHours
integer
No
An integer representing the time (in hours) that each backup is retained
backupStorageRedundancy
string
No
Enum to indicate type of backup storage redundancy. - Geo, Local, Zone
CorsPolicy object
Name
Type
Required
Value
allowedOrigins
string
Yes
The origin domains that are permitted to make a request against the service via CORS.
allowedMethods
string
No
The methods (HTTP request verbs) that the origin domain may use for a CORS request.
allowedHeaders
string
No
The request headers that the origin domain may specify on the CORS request.
exposedHeaders
string
No
The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
maxAgeInSeconds
integer
No
The maximum amount time that a browser should cache the preflight OPTIONS request.
RestoreParameters object
Name
Type
Required
Value
restoreMode
string
No
Describes the mode of the restore. - PointInTime
restoreSource
string
No
The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
restoreTimestampInUtc
string
No
Time to which the account has to be restored (ISO-8601 format).
This template creates an Azure Cosmos DB account for any API Type with a primary and secondary region with choice of consistency level and options to enable multi-master and Failover Type.
This template creates an Azure Cosmos DB account for MongoDB API (3.2 or 3.6) in two regions using shared autoscale database throughput with two collections.
This template creates an Azure Cosmos account, injects the Cosmos DB endpoint and keys into Azure Web App settings, then deploys an ASP MVC web app from GitHub.
This template deploys an Azure Cosmos DB account, an App Service Plan, and creates a Web App in the App Service Plan. It also adds two Application settings to the Web App that reference the Azure Cosmos DB account endpoint. This way solutions deployed to the Web App can connect to the Azure Cosmos DB account endpoint using those settings.
Containers make it very easy for you to continuously build and deploy your applications. By orchestrating deployment of those containers using Kubernetes in Azure Container Service, you can achieve replicable, manageable clusters of containers. By setting up a continuous build to produce your container images and orchestration, you can increase the speed and reliability of your deployment.