Skip to main content

databases

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

Overview

Namedatabases
TypeResource
Idazure.sql.databases

Fields

NameDatatypeDescription
auto_pause_delaytextfield from the properties object
availability_zonetextfield from the properties object
catalog_collationtextfield from the properties object
collationtextfield from the properties object
create_modetextfield from the properties object
creation_datetextfield from the properties object
current_backup_storage_redundancytextfield from the properties object
current_service_objective_nametextfield from the properties object
current_skutextfield from the properties object
databaseNametextfield from the properties object
database_idtextfield from the properties object
default_secondary_locationtextfield from the properties object
earliest_restore_datetextfield from the properties object
elastic_pool_idtextfield from the properties object
encryption_protectortextfield from the properties object
encryption_protector_auto_rotationtextfield from the properties object
failover_group_idtextfield from the properties object
federated_client_idtextfield from the properties object
free_limit_exhaustion_behaviortextfield from the properties object
high_availability_replica_counttextfield from the properties object
identitytextAzure Active Directory identity configuration for a resource.
is_infra_encryption_enabledtextfield from the properties object
is_ledger_ontextfield from the properties object
keystextfield from the properties object
kindtextKind of database. This is metadata used for the Azure portal experience.
license_typetextfield from the properties object
locationtextResource location.
long_term_retention_backup_resource_idtextfield from the properties object
maintenance_configuration_idtextfield from the properties object
managed_bytextfield from the properties object
manual_cutovertextfield from the properties object
max_log_size_bytestextfield from the properties object
max_size_bytestextfield from the properties object
min_capacitytextfield from the properties object
paused_datetextfield from the properties object
perform_cutovertextfield from the properties object
preferred_enclave_typetextfield from the properties object
read_scaletextfield from the properties object
recoverable_database_idtextfield from the properties object
recovery_services_recovery_point_idtextfield from the properties object
requested_backup_storage_redundancytextfield from the properties object
requested_service_objective_nametextfield from the properties object
resourceGroupNametextfield from the properties object
restorable_dropped_database_idtextfield from the properties object
restore_point_in_timetextfield from the properties object
resumed_datetextfield from the properties object
sample_nametextfield from the properties object
secondary_typetextfield from the properties object
serverNametextfield from the properties object
skutextAn ARM Resource SKU.
source_database_deletion_datetextfield from the properties object
source_database_idtextfield from the properties object
source_resource_idtextfield from the properties object
statustextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
use_free_limittextfield from the properties object
zone_redundanttextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets a database.
list_by_elastic_poolSELECTelasticPoolName, resourceGroupName, serverName, subscriptionIdGets a list of databases in an elastic pool.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdGets a list of databases.
create_or_updateINSERTdatabaseName, resourceGroupName, serverName, subscriptionId, data__locationCreates a new database or updates an existing database.
deleteDELETEdatabaseName, resourceGroupName, serverName, subscriptionIdDeletes the database.
updateUPDATEdatabaseName, resourceGroupName, serverName, subscriptionIdUpdates an existing database.
exportEXECdatabaseName, resourceGroupName, serverName, subscriptionId, data__administratorLogin, data__administratorLoginPassword, data__storageKey, data__storageKeyType, data__storageUriExports a database.
failoverEXECdatabaseName, resourceGroupName, serverName, subscriptionIdFailovers a database.
importEXECdatabaseName, resourceGroupName, serverName, subscriptionId, data__administratorLogin, data__administratorLoginPassword, data__storageKey, data__storageKeyType, data__storageUriImports a bacpac into a new database.
pauseEXECdatabaseName, resourceGroupName, serverName, subscriptionIdPauses a database.
renameEXECdatabaseName, resourceGroupName, serverName, subscriptionId, data__idRenames a database.
resumeEXECdatabaseName, resourceGroupName, serverName, subscriptionIdResumes a database.
upgrade_data_warehouseEXECdatabaseName, resourceGroupName, serverName, subscriptionIdUpgrades a data warehouse.

SELECT examples

Gets a list of databases.

SELECT
auto_pause_delay,
availability_zone,
catalog_collation,
collation,
create_mode,
creation_date,
current_backup_storage_redundancy,
current_service_objective_name,
current_sku,
databaseName,
database_id,
default_secondary_location,
earliest_restore_date,
elastic_pool_id,
encryption_protector,
encryption_protector_auto_rotation,
failover_group_id,
federated_client_id,
free_limit_exhaustion_behavior,
high_availability_replica_count,
identity,
is_infra_encryption_enabled,
is_ledger_on,
keys,
kind,
license_type,
location,
long_term_retention_backup_resource_id,
maintenance_configuration_id,
managed_by,
manual_cutover,
max_log_size_bytes,
max_size_bytes,
min_capacity,
paused_date,
perform_cutover,
preferred_enclave_type,
read_scale,
recoverable_database_id,
recovery_services_recovery_point_id,
requested_backup_storage_redundancy,
requested_service_objective_name,
resourceGroupName,
restorable_dropped_database_id,
restore_point_in_time,
resumed_date,
sample_name,
secondary_type,
serverName,
sku,
source_database_deletion_date,
source_database_id,
source_resource_id,
status,
subscriptionId,
tags,
use_free_limit,
zone_redundant
FROM azure.sql.vw_databases
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.databases (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
data__location,
location,
tags,
sku,
identity,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ data__location }}',
'{{ location }}',
'{{ tags }}',
'{{ sku }}',
'{{ identity }}',
'{{ properties }}'
;

UPDATE example

Updates a databases resource.

/*+ update */
UPDATE azure.sql.databases
SET
sku = '{{ sku }}',
identity = '{{ identity }}',
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified databases resource.

/*+ delete */
DELETE FROM azure.sql.databases
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';