Bicep resource definition
The databaseAccounts/cassandraKeyspaces/tables resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
Bicep Samples
A basic example of deploying Cassandra Table within a Cosmos DB Cassandra Keyspace.
param location string = 'eastus'
param resourceName string = 'acctest0001'
var accountName = toLower(replace(resourceName, '-', ''))
var keyspaceName = '${toLower(resourceName)}ks'
var tableName = '${toLower(resourceName)}tbl'
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2024-08-15' = {
name: accountName
location: location
kind: 'GlobalDocumentDB'
properties: {
capabilities: [
{
name: 'EnableCassandra'
}
]
consistencyPolicy: {
defaultConsistencyLevel: 'Strong'
maxIntervalInSeconds: 5
maxStalenessPrefix: 100
}
databaseAccountOfferType: 'Standard'
defaultIdentity: 'FirstPartyIdentity'
disableKeyBasedMetadataWriteAccess: false
disableLocalAuth: false
enableAnalyticalStorage: true
enableAutomaticFailover: false
enableBurstCapacity: false
enableFreeTier: false
enableMultipleWriteLocations: false
enablePartitionMerge: false
ipRules: []
isVirtualNetworkFilterEnabled: false
locations: [
{
failoverPriority: 0
isZoneRedundant: false
locationName: location
}
]
minimalTlsVersion: 'Tls12'
networkAclBypass: 'None'
networkAclBypassResourceIds: []
publicNetworkAccess: 'Enabled'
virtualNetworkRules: []
}
}
resource cassandraKeyspace 'Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces@2021-10-15' = {
name: keyspaceName
parent: databaseAccount
properties: {
options: {}
resource: {
id: keyspaceName
}
}
}
resource table 'Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables@2021-10-15' = {
name: tableName
parent: cassandraKeyspace
properties: {
options: {}
resource: {
analyticalStorageTtl: 1
id: tableName
schema: {
clusterKeys: []
columns: [
{
name: 'test1'
type: 'ascii'
}
{
name: 'test2'
type: 'int'
}
]
partitionKeys: [
{
name: 'test1'
}
]
}
}
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
To create a Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables@2026-04-01-preview' = {
parent: resourceSymbolicName
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: 'string'
}
}
location: 'string'
name: 'string'
properties: {
options: {
autoscaleSettings: {
maxThroughput: int
}
throughput: int
}
resource: {
analyticalStorageTtl: int
defaultTtl: int
id: 'string'
schema: {
clusterKeys: [
{
name: 'string'
orderBy: 'string'
}
]
columns: [
{
name: 'string'
type: 'string'
}
]
partitionKeys: [
{
name: 'string'
}
]
}
}
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables
AutoscaleSettings
| Name |
Description |
Value |
| maxThroughput |
Represents maximum throughput, the resource can scale up to. |
int |
CassandraPartitionKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table partition key |
string |
CassandraSchema
CassandraTableGetProperties
CassandraTableGetPropertiesOptions
| Name |
Description |
Value |
| autoscaleSettings |
Specifies the Autoscale settings. |
AutoscaleSettings |
| throughput |
Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. |
int |
CassandraTableGetPropertiesResource
| Name |
Description |
Value |
| analyticalStorageTtl |
Analytical TTL. |
int |
| defaultTtl |
Time to live of the Cosmos DB Cassandra table |
int |
| id |
Name of the Cosmos DB Cassandra table |
string (required) |
| schema |
Schema of the Cosmos DB Cassandra table |
CassandraSchema |
ClusterKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table cluster key |
string |
| orderBy |
Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" |
string |
Column
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table column |
string |
| type |
Type of the Cosmos DB Cassandra table column |
string |
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
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. |
'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
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}'. |
Record |
Record
ARM template resource definition
The databaseAccounts/cassandraKeyspaces/tables resource type can be deployed with operations that target:
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
To create a Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables resource, add the following JSON to your template.
{
"type": "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables",
"apiVersion": "2026-04-01-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": "string"
}
},
"location": "string",
"properties": {
"options": {
"autoscaleSettings": {
"maxThroughput": "int"
},
"throughput": "int"
},
"resource": {
"analyticalStorageTtl": "int",
"defaultTtl": "int",
"id": "string",
"schema": {
"clusterKeys": [
{
"name": "string",
"orderBy": "string"
}
],
"columns": [
{
"name": "string",
"type": "string"
}
],
"partitionKeys": [
{
"name": "string"
}
]
}
}
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables
| Name |
Description |
Value |
| apiVersion |
The api version |
'2026-04-01-preview' |
| identity |
Identity for the resource. |
ManagedServiceIdentity |
| location |
The location of the resource group to which the resource belongs. |
string |
| name |
The resource name |
string (required) |
| properties |
The properties of an Azure Cosmos DB Cassandra table |
CassandraTableGetProperties |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
| type |
The resource type |
'Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables' |
AutoscaleSettings
| Name |
Description |
Value |
| maxThroughput |
Represents maximum throughput, the resource can scale up to. |
int |
CassandraPartitionKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table partition key |
string |
CassandraSchema
CassandraTableGetProperties
CassandraTableGetPropertiesOptions
| Name |
Description |
Value |
| autoscaleSettings |
Specifies the Autoscale settings. |
AutoscaleSettings |
| throughput |
Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. |
int |
CassandraTableGetPropertiesResource
| Name |
Description |
Value |
| analyticalStorageTtl |
Analytical TTL. |
int |
| defaultTtl |
Time to live of the Cosmos DB Cassandra table |
int |
| id |
Name of the Cosmos DB Cassandra table |
string (required) |
| schema |
Schema of the Cosmos DB Cassandra table |
CassandraSchema |
ClusterKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table cluster key |
string |
| orderBy |
Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" |
string |
Column
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table column |
string |
| type |
Type of the Cosmos DB Cassandra table column |
string |
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
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. |
'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
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}'. |
Record |
Record
The databaseAccounts/cassandraKeyspaces/tables resource type can be deployed with operations that target:
- Resource groups
For a list of changed properties in each API version, see change log.
Usage Examples
A basic example of deploying Cassandra Table within a Cosmos DB Cassandra Keyspace.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
# This base name will be used to derive all other resource names.
}
variable "location" {
type = string
default = "eastus"
}
locals {
# Cosmos DB account names must be globally unique, 3-44 chars, lowercase letters or numbers only.
# Derive names from the base resource_name; users can override via terraform.tfvars to ensure uniqueness.
account_name = lower(replace(var.resource_name, "-", ""))
keyspace_name = "${lower(var.resource_name)}ks"
table_name = "${lower(var.resource_name)}tbl"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "databaseAccount" {
type = "Microsoft.DocumentDB/databaseAccounts@2024-08-15"
parent_id = azapi_resource.resourceGroup.id
name = local.account_name
location = var.location
body = {
kind = "GlobalDocumentDB"
properties = {
backupPolicy = null
capabilities = [{
name = "EnableCassandra"
}]
consistencyPolicy = {
defaultConsistencyLevel = "Strong"
maxIntervalInSeconds = 5
maxStalenessPrefix = 100
}
databaseAccountOfferType = "Standard"
defaultIdentity = "FirstPartyIdentity"
disableKeyBasedMetadataWriteAccess = false
disableLocalAuth = false
enableAnalyticalStorage = true
enableAutomaticFailover = false
enableBurstCapacity = false
enableFreeTier = false
enableMultipleWriteLocations = false
enablePartitionMerge = false
ipRules = []
isVirtualNetworkFilterEnabled = false
locations = [{
failoverPriority = 0
isZoneRedundant = false
locationName = var.location
}]
minimalTlsVersion = "Tls12"
networkAclBypass = "None"
networkAclBypassResourceIds = []
publicNetworkAccess = "Enabled"
virtualNetworkRules = []
}
}
}
resource "azapi_resource" "cassandraKeyspace" {
type = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces@2021-10-15"
parent_id = azapi_resource.databaseAccount.id
name = local.keyspace_name
body = {
properties = {
options = {}
resource = {
id = local.keyspace_name
}
}
}
}
resource "azapi_resource" "table" {
type = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables@2021-10-15"
parent_id = azapi_resource.cassandraKeyspace.id
name = local.table_name
body = {
properties = {
options = {}
resource = {
analyticalStorageTtl = 1
id = local.table_name
schema = {
clusterKeys = []
columns = [{
name = "test1"
type = "ascii"
}, {
name = "test2"
type = "int"
}]
partitionKeys = [{
name = "test1"
}]
}
}
}
}
}
To create a Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables@2026-04-01-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
options = {
autoscaleSettings = {
maxThroughput = int
}
throughput = int
}
resource = {
analyticalStorageTtl = int
defaultTtl = int
id = "string"
schema = {
clusterKeys = [
{
name = "string"
orderBy = "string"
}
]
columns = [
{
name = "string"
type = "string"
}
]
partitionKeys = [
{
name = "string"
}
]
}
}
}
}
}
Property Values
Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables
| Name |
Description |
Value |
| identity |
Identity for the resource. |
ManagedServiceIdentity |
| location |
The location of the resource group to which the resource belongs. |
string |
| name |
The resource name |
string (required) |
| parent_id |
The ID of the resource that is the parent for this resource. |
ID for resource of type: databaseAccounts/cassandraKeyspaces |
| properties |
The properties of an Azure Cosmos DB Cassandra table |
CassandraTableGetProperties |
| tags |
Resource tags |
Dictionary of tag names and values. |
| type |
The resource type |
"Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables@2026-04-01-preview" |
AutoscaleSettings
| Name |
Description |
Value |
| maxThroughput |
Represents maximum throughput, the resource can scale up to. |
int |
CassandraPartitionKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table partition key |
string |
CassandraSchema
CassandraTableGetProperties
CassandraTableGetPropertiesOptions
| Name |
Description |
Value |
| autoscaleSettings |
Specifies the Autoscale settings. |
AutoscaleSettings |
| throughput |
Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. |
int |
CassandraTableGetPropertiesResource
| Name |
Description |
Value |
| analyticalStorageTtl |
Analytical TTL. |
int |
| defaultTtl |
Time to live of the Cosmos DB Cassandra table |
int |
| id |
Name of the Cosmos DB Cassandra table |
string (required) |
| schema |
Schema of the Cosmos DB Cassandra table |
CassandraSchema |
ClusterKey
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table cluster key |
string |
| orderBy |
Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" |
string |
Column
| Name |
Description |
Value |
| name |
Name of the Cosmos DB Cassandra table column |
string |
| type |
Type of the Cosmos DB Cassandra table column |
string |
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
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. |
'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
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}'. |
Record |
Record