database_accounts
Creates, updates, deletes, gets or lists a database_accounts
resource.
Overview
Name | database_accounts |
Type | Resource |
Id | azure.cosmos_db.database_accounts |
Fields
- vw_database_accounts
- database_accounts
Name | Datatype | Description |
---|---|---|
id | text | The unique resource identifier of the ARM resource. |
name | text | The name of the ARM resource. |
accountName | text | field from the properties object |
analytical_storage_configuration | text | field from the properties object |
api_properties | text | field from the properties object |
backup_policy | text | field from the properties object |
capabilities | text | field from the properties object |
capacity | text | field from the properties object |
capacity_mode | text | field from the properties object |
capacity_mode_change_transition_state | text | field from the properties object |
connector_offer | text | field from the properties object |
consistency_policy | text | field from the properties object |
cors | text | field from the properties object |
create_mode | text | field from the properties object |
customer_managed_key_status | text | field from the properties object |
database_account_offer_type | text | field from the properties object |
default_identity | text | field from the properties object |
default_priority_level | text | field from the properties object |
diagnostic_log_settings | text | field from the properties object |
disable_key_based_metadata_write_access | text | field from the properties object |
disable_local_auth | text | field from the properties object |
document_endpoint | text | field from the properties object |
enable_analytical_storage | text | field from the properties object |
enable_automatic_failover | text | field from the properties object |
enable_burst_capacity | text | field from the properties object |
enable_cassandra_connector | text | field from the properties object |
enable_free_tier | text | field from the properties object |
enable_materialized_views | text | field from the properties object |
enable_multiple_write_locations | text | field from the properties object |
enable_partition_merge | text | field from the properties object |
enable_per_region_per_partition_autoscale | text | field from the properties object |
enable_priority_based_execution | text | field from the properties object |
failover_policies | text | field from the properties object |
identity | text | Identity for the resource. |
instance_id | text | field from the properties object |
ip_rules | text | field from the properties object |
is_virtual_network_filter_enabled | text | field from the properties object |
key_vault_key_uri | text | field from the properties object |
keys_metadata | text | field from the properties object |
kind | text | Indicates the type of database account. This can only be set at database account creation. |
location | text | The location of the resource group to which the resource belongs. |
locations | text | field from the properties object |
minimal_tls_version | text | field from the properties object |
network_acl_bypass | text | field from the properties object |
network_acl_bypass_resource_ids | text | field from the properties object |
private_endpoint_connections | text | field from the properties object |
provisioning_state | text | field from the properties object |
public_network_access | text | field from the properties object |
read_locations | text | field from the properties object |
resourceGroupName | text | field from the properties object |
restore_parameters | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
tags | text | 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". |
type | text | The type of Azure resource. |
virtual_network_rules | text | field from the properties object |
write_locations | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the ARM resource. |
name | string | The name of the ARM resource. |
identity | object | Identity for the resource. |
kind | string | Indicates the type of database account. This can only be set at database account creation. |
location | string | The location of the resource group to which the resource belongs. |
properties | object | Properties for the database account. |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
tags | object | 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". |
type | string | The type of Azure resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | accountName, resourceGroupName, subscriptionId | Retrieves the properties of an existing Azure Cosmos DB database account. |
list | SELECT | subscriptionId | Lists all the Azure Cosmos DB database accounts available under the subscription. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Lists all the Azure Cosmos DB database accounts available under the given resource group. |
create_or_update | INSERT | accountName, resourceGroupName, subscriptionId, data__properties | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. |
delete | DELETE | accountName, resourceGroupName, subscriptionId | Deletes an existing Azure Cosmos DB database account. |
update | UPDATE | accountName, resourceGroupName, subscriptionId | Updates the properties of an existing Azure Cosmos DB database account. |
failover_priority_change | EXEC | accountName, resourceGroupName, subscriptionId, data__failoverPolicies | Changes the failover priority for the Azure Cosmos DB database account. 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. |
offline_region | EXEC | accountName, resourceGroupName, subscriptionId, data__region | Offline the specified region for the specified Azure Cosmos DB database account. |
online_region | EXEC | accountName, resourceGroupName, subscriptionId, data__region | Online the specified region for the specified Azure Cosmos DB database account. |
regenerate_key | EXEC | accountName, resourceGroupName, subscriptionId, data__keyKind | Regenerates an access key for the specified Azure Cosmos DB database account. |
SELECT
examples
Lists all the Azure Cosmos DB database accounts available under the subscription.
- vw_database_accounts
- database_accounts
SELECT
id,
name,
accountName,
analytical_storage_configuration,
api_properties,
backup_policy,
capabilities,
capacity,
capacity_mode,
capacity_mode_change_transition_state,
connector_offer,
consistency_policy,
cors,
create_mode,
customer_managed_key_status,
database_account_offer_type,
default_identity,
default_priority_level,
diagnostic_log_settings,
disable_key_based_metadata_write_access,
disable_local_auth,
document_endpoint,
enable_analytical_storage,
enable_automatic_failover,
enable_burst_capacity,
enable_cassandra_connector,
enable_free_tier,
enable_materialized_views,
enable_multiple_write_locations,
enable_partition_merge,
enable_per_region_per_partition_autoscale,
enable_priority_based_execution,
failover_policies,
identity,
instance_id,
ip_rules,
is_virtual_network_filter_enabled,
key_vault_key_uri,
keys_metadata,
kind,
location,
locations,
minimal_tls_version,
network_acl_bypass,
network_acl_bypass_resource_ids,
private_endpoint_connections,
provisioning_state,
public_network_access,
read_locations,
resourceGroupName,
restore_parameters,
subscriptionId,
system_data,
tags,
type,
virtual_network_rules,
write_locations
FROM azure.cosmos_db.vw_database_accounts
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type
FROM azure.cosmos_db.database_accounts
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new database_accounts
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.cosmos_db.database_accounts (
accountName,
resourceGroupName,
subscriptionId,
data__properties,
kind,
identity,
properties,
location,
tags
)
SELECT
'{{ accountName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ kind }}',
'{{ identity }}',
'{{ properties }}',
'{{ location }}',
'{{ tags }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: identity
value:
- name: principalId
value: string
- name: tenantId
value: string
- name: type
value: string
- name: userAssignedIdentities
value: object
- name: properties
value:
- name: consistencyPolicy
value:
- name: defaultConsistencyLevel
value: string
- name: maxStalenessPrefix
value: integer
- name: maxIntervalInSeconds
value: integer
- name: locations
value:
- - name: id
value: string
- name: locationName
value: string
- name: documentEndpoint
value: string
- name: provisioningState
value: []
- name: failoverPriority
value: integer
- name: isZoneRedundant
value: boolean
- name: databaseAccountOfferType
value: []
- name: ipRules
value: []
- name: isVirtualNetworkFilterEnabled
value: boolean
- name: enableAutomaticFailover
value: boolean
- name: capabilities
value:
- - name: name
value: string
- name: virtualNetworkRules
value:
- - name: id
value: string
- name: ignoreMissingVNetServiceEndpoint
value: boolean
- name: enableMultipleWriteLocations
value: boolean
- name: enableCassandraConnector
value: boolean
- name: connectorOffer
value: []
- name: disableKeyBasedMetadataWriteAccess
value: boolean
- name: keyVaultKeyUri
value: string
- name: defaultIdentity
value: string
- name: publicNetworkAccess
value: []
- name: enableFreeTier
value: boolean
- name: apiProperties
value:
- name: serverVersion
value: string
- name: enableAnalyticalStorage
value: boolean
- name: analyticalStorageConfiguration
value:
- name: schemaType
value: []
- name: createMode
value: []
- name: backupPolicy
value:
- name: type
value: []
- name: migrationState
value:
- name: status
value: []
- name: startTime
value: string
- name: cors
value:
- - name: allowedOrigins
value: string
- name: allowedMethods
value: string
- name: allowedHeaders
value: string
- name: exposedHeaders
value: string
- name: maxAgeInSeconds
value: integer
- name: networkAclBypass
value: []
- name: networkAclBypassResourceIds
value:
- string
- name: diagnosticLogSettings
value:
- name: enableFullTextQuery
value: string
- name: disableLocalAuth
value: boolean
- name: restoreParameters
value:
- name: restoreMode
value: string
- name: restoreSource
value: string
- name: restoreTimestampInUtc
value: string
- name: databasesToRestore
value:
- - name: databaseName
value: string
- name: collectionNames
value:
- []
- name: gremlinDatabasesToRestore
value:
- - name: databaseName
value: string
- name: graphNames
value:
- []
- name: tablesToRestore
value:
- []
- name: sourceBackupLocation
value: string
- name: restoreWithTtlDisabled
value: boolean
- name: capacity
value:
- name: totalThroughputLimit
value: integer
- name: capacityMode
value: []
- name: enableMaterializedViews
value: boolean
- name: keysMetadata
value:
- name: primaryMasterKey
value:
- name: generationTime
value: string
- name: enablePartitionMerge
value: boolean
- name: enableBurstCapacity
value: boolean
- name: minimalTlsVersion
value: []
- name: customerManagedKeyStatus
value: string
- name: enablePriorityBasedExecution
value: boolean
- name: defaultPriorityLevel
value: []
- name: enablePerRegionPerPartitionAutoscale
value: boolean
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: []
UPDATE
example
Updates a database_accounts
resource.
/*+ update */
UPDATE azure.cosmos_db.database_accounts
SET
tags = '{{ tags }}',
location = '{{ location }}',
identity = '{{ identity }}',
properties = '{{ properties }}'
WHERE
accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified database_accounts
resource.
/*+ delete */
DELETE FROM azure.cosmos_db.database_accounts
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';