Skip to main content

database_accounts

Creates, updates, deletes, gets or lists a database_accounts resource.

Overview

Namedatabase_accounts
TypeResource
Idazure.cosmos_db.database_accounts

Fields

NameDatatypeDescription
idtextThe unique resource identifier of the ARM resource.
nametextThe name of the ARM resource.
accountNametextfield from the properties object
analytical_storage_configurationtextfield from the properties object
api_propertiestextfield from the properties object
backup_policytextfield from the properties object
capabilitiestextfield from the properties object
capacitytextfield from the properties object
capacity_modetextfield from the properties object
capacity_mode_change_transition_statetextfield from the properties object
connector_offertextfield from the properties object
consistency_policytextfield from the properties object
corstextfield from the properties object
create_modetextfield from the properties object
customer_managed_key_statustextfield from the properties object
database_account_offer_typetextfield from the properties object
default_identitytextfield from the properties object
default_priority_leveltextfield from the properties object
diagnostic_log_settingstextfield from the properties object
disable_key_based_metadata_write_accesstextfield from the properties object
disable_local_authtextfield from the properties object
document_endpointtextfield from the properties object
enable_analytical_storagetextfield from the properties object
enable_automatic_failovertextfield from the properties object
enable_burst_capacitytextfield from the properties object
enable_cassandra_connectortextfield from the properties object
enable_free_tiertextfield from the properties object
enable_materialized_viewstextfield from the properties object
enable_multiple_write_locationstextfield from the properties object
enable_partition_mergetextfield from the properties object
enable_per_region_per_partition_autoscaletextfield from the properties object
enable_priority_based_executiontextfield from the properties object
failover_policiestextfield from the properties object
identitytextIdentity for the resource.
instance_idtextfield from the properties object
ip_rulestextfield from the properties object
is_virtual_network_filter_enabledtextfield from the properties object
key_vault_key_uritextfield from the properties object
keys_metadatatextfield from the properties object
kindtextIndicates the type of database account. This can only be set at database account creation.
locationtextThe location of the resource group to which the resource belongs.
locationstextfield from the properties object
minimal_tls_versiontextfield from the properties object
network_acl_bypasstextfield from the properties object
network_acl_bypass_resource_idstextfield from the properties object
private_endpoint_connectionstextfield from the properties object
provisioning_statetextfield from the properties object
public_network_accesstextfield from the properties object
read_locationstextfield from the properties object
resourceGroupNametextfield from the properties object
restore_parameterstextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextTags 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".
typetextThe type of Azure resource.
virtual_network_rulestextfield from the properties object
write_locationstextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccountName, resourceGroupName, subscriptionIdRetrieves the properties of an existing Azure Cosmos DB database account.
listSELECTsubscriptionIdLists all the Azure Cosmos DB database accounts available under the subscription.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdLists all the Azure Cosmos DB database accounts available under the given resource group.
create_or_updateINSERTaccountName, resourceGroupName, subscriptionId, data__propertiesCreates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
deleteDELETEaccountName, resourceGroupName, subscriptionIdDeletes an existing Azure Cosmos DB database account.
updateUPDATEaccountName, resourceGroupName, subscriptionIdUpdates the properties of an existing Azure Cosmos DB database account.
failover_priority_changeEXECaccountName, resourceGroupName, subscriptionId, data__failoverPoliciesChanges 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_regionEXECaccountName, resourceGroupName, subscriptionId, data__regionOffline the specified region for the specified Azure Cosmos DB database account.
online_regionEXECaccountName, resourceGroupName, subscriptionId, data__regionOnline the specified region for the specified Azure Cosmos DB database account.
regenerate_keyEXECaccountName, resourceGroupName, subscriptionId, data__keyKindRegenerates 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.

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new database_accounts resource.

/*+ 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 }}'
;

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 }}';