managed_databases
Creates, updates, deletes, gets or lists a managed_databases
resource.
Overview
Name | managed_databases |
Type | Resource |
Id | azure.sql.managed_databases |
Fields
- vw_managed_databases
- managed_databases
Name | Datatype | Description |
---|---|---|
auto_complete_restore | text | field from the properties object |
catalog_collation | text | field from the properties object |
collation | text | field from the properties object |
create_mode | text | field from the properties object |
creation_date | text | field from the properties object |
cross_subscription_restorable_dropped_database_id | text | field from the properties object |
cross_subscription_source_database_id | text | field from the properties object |
cross_subscription_target_managed_instance_id | text | field from the properties object |
databaseName | text | field from the properties object |
default_secondary_location | text | field from the properties object |
earliest_restore_point | text | field from the properties object |
failover_group_id | text | field from the properties object |
is_ledger_on | text | field from the properties object |
last_backup_name | text | field from the properties object |
location | text | Resource location. |
long_term_retention_backup_resource_id | text | field from the properties object |
managedInstanceName | text | field from the properties object |
recoverable_database_id | text | field from the properties object |
resourceGroupName | text | field from the properties object |
restorable_dropped_database_id | text | field from the properties object |
restore_point_in_time | text | field from the properties object |
source_database_id | text | field from the properties object |
status | text | field from the properties object |
storage_container_identity | text | field from the properties object |
storage_container_sas_token | text | field from the properties object |
storage_container_uri | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
Name | Datatype | Description |
---|---|---|
location | string | Resource location. |
properties | object | The managed database's properties. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, managedInstanceName, resourceGroupName, subscriptionId | Gets a managed database. |
create_or_update | INSERT | databaseName, managedInstanceName, resourceGroupName, subscriptionId, data__location | Creates a new database or updates an existing database. |
delete | DELETE | databaseName, managedInstanceName, resourceGroupName, subscriptionId | Deletes a managed database. |
update | UPDATE | databaseName, managedInstanceName, resourceGroupName, subscriptionId | Updates an existing database. |
cancel_move | EXEC | databaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseId | Cancels a managed database move operation. |
complete_move | EXEC | databaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseId | Completes a managed database move operation. |
complete_restore | EXEC | databaseName, managedInstanceName, resourceGroupName, subscriptionId, data__lastBackupName | Completes the restore operation on a managed database. |
start_move | EXEC | databaseName, managedInstanceName, resourceGroupName, subscriptionId, data__destinationManagedDatabaseId | Starts a managed database move operation. |
SELECT
examples
Gets a managed database.
- vw_managed_databases
- managed_databases
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 }}';
SELECT
location,
properties,
tags
FROM azure.sql.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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: collation
value: string
- name: status
value: string
- name: creationDate
value: string
- name: earliestRestorePoint
value: string
- name: restorePointInTime
value: string
- name: defaultSecondaryLocation
value: string
- name: catalogCollation
value: string
- name: createMode
value: string
- name: storageContainerUri
value: string
- name: sourceDatabaseId
value: string
- name: crossSubscriptionSourceDatabaseId
value: string
- name: restorableDroppedDatabaseId
value: string
- name: crossSubscriptionRestorableDroppedDatabaseId
value: string
- name: storageContainerIdentity
value: string
- name: storageContainerSasToken
value: string
- name: failoverGroupId
value: string
- name: recoverableDatabaseId
value: string
- name: longTermRetentionBackupResourceId
value: string
- name: autoCompleteRestore
value: boolean
- name: lastBackupName
value: string
- name: crossSubscriptionTargetManagedInstanceId
value: string
- name: isLedgerOn
value: boolean
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 }}';