Skip to main content

managed_databases

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

Overview

Namemanaged_databases
TypeResource
Idazure.sql.managed_databases

Fields

NameDatatypeDescription
auto_complete_restoretextfield 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
cross_subscription_restorable_dropped_database_idtextfield from the properties object
cross_subscription_source_database_idtextfield from the properties object
cross_subscription_target_managed_instance_idtextfield from the properties object
databaseNametextfield from the properties object
default_secondary_locationtextfield from the properties object
earliest_restore_pointtextfield from the properties object
failover_group_idtextfield from the properties object
is_ledger_ontextfield from the properties object
last_backup_nametextfield from the properties object
locationtextResource location.
long_term_retention_backup_resource_idtextfield from the properties object
managedInstanceNametextfield from the properties object
recoverable_database_idtextfield 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
source_database_idtextfield from the properties object
statustextfield from the properties object
storage_container_identitytextfield from the properties object
storage_container_sas_tokentextfield from the properties object
storage_container_uritextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, managedInstanceName, resourceGroupName, subscriptionIdGets a managed database.
create_or_updateINSERTdatabaseName, managedInstanceName, resourceGroupName, subscriptionId, data__locationCreates a new database or updates an existing database.
deleteDELETEdatabaseName, managedInstanceName, resourceGroupName, subscriptionIdDeletes a managed database.
updateUPDATEdatabaseName, managedInstanceName, resourceGroupName, subscriptionIdUpdates an existing database.
cancel_moveEXECdatabaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseIdCancels a managed database move operation.
complete_moveEXECdatabaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseIdCompletes a managed database move operation.
complete_restoreEXECdatabaseName, managedInstanceName, resourceGroupName, subscriptionId, data__lastBackupNameCompletes the restore operation on a managed database.
start_moveEXECdatabaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseIdStarts a managed database move operation.

SELECT examples

Gets a managed database.

SELECT
auto_complete_restore,
catalog_collation,
collation,
create_mode,
creation_date,
cross_subscription_restorable_dropped_database_id,
cross_subscription_source_database_id,
cross_subscription_target_managed_instance_id,
databaseName,
default_secondary_location,
earliest_restore_point,
failover_group_id,
is_ledger_on,
last_backup_name,
location,
long_term_retention_backup_resource_id,
managedInstanceName,
recoverable_database_id,
resourceGroupName,
restorable_dropped_database_id,
restore_point_in_time,
source_database_id,
status,
storage_container_identity,
storage_container_sas_token,
storage_container_uri,
subscriptionId,
tags
FROM azure.sql.vw_managed_databases
WHERE databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

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

UPDATE example

Updates a managed_databases resource.

/*+ update */
UPDATE azure.sql.managed_databases
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified managed_databases resource.

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