Skip to main content

database_operations

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

Overview

Namedatabase_operations
TypeResource
Idazure.sql.database_operations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
databaseNamestringThe name of the database the operation is being performed on.
descriptionstringThe operation description.
errorCodeintegerThe operation error code.
errorDescriptionstringThe operation error description.
errorSeverityintegerThe operation error severity.
estimatedCompletionTimestring (date-time)The estimated completion time of the operation.
isCancellablebooleanWhether the operation can be cancelled.
isUserErrorbooleanWhether or not the error is a user error.
operationstringThe name of operation.
operationFriendlyNamestringThe friendly name of operation.
operationPhaseDetailsobjectThe operation phase details.
percentCompleteintegerThe percentage of the operation completed.
serverNamestringThe name of the server.
startTimestring (date-time)The operation start time.
statestringThe operation state. Known values are: "Pending", "InProgress", "Succeeded", "Failed", "CancelInProgress", and "Cancelled". (Pending, InProgress, Succeeded, Failed, CancelInProgress, Cancelled)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_databaseselectresource_group_name, server_name, database_name, subscription_idGets a list of operations performed on the database.
cancelexecresource_group_name, server_name, database_name, operation_id, subscription_idCancels the asynchronous operation on the database.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_namestringThe name of the database. Required.
operation_idstringThe operation identifier. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
server_namestringThe name of the server. Required.
subscription_idstring

SELECT examples

Gets a list of operations performed on the database.

SELECT
id,
name,
databaseName,
description,
errorCode,
errorDescription,
errorSeverity,
estimatedCompletionTime,
isCancellable,
isUserError,
operation,
operationFriendlyName,
operationPhaseDetails,
percentComplete,
serverName,
startTime,
state,
systemData,
type
FROM azure.sql.database_operations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

Lifecycle Methods

Cancels the asynchronous operation on the database.

EXEC azure.sql.database_operations.cancel 
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@operation_id='{{ operation_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;