Skip to main content

tasks

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

Overview

Nametasks
TypeResource
Idazure.data_migration.tasks

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.
clientDataobjectKey value pairs of client data to attach meta data information to task.
commandsarrayArray of command properties.
errorsarrayArray of errors. This is ignored if submitted.
etagstringHTTP strong entity tag value. This is ignored if submitted.
statestringThe state of the task. This is ignored if submitted. Known values are: "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted". (Unknown, Queued, Running, Canceled, Succeeded, Failed, FailedInputValidation, Faulted)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
taskTypestringTask type. Required. Known values are: "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", "ConnectToTarget.AzureDbForPostgreSql.Sync", "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", and "MigrateSchemaSqlServerSqlDb".
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
getselectgroup_name, service_name, project_name, task_name, subscription_id$expandGet task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The GET method retrieves information about a task.
listselectgroup_name, service_name, project_name, subscription_idtaskTypeGet tasks in a service. The services resource is the top-level resource that represents the Azure Database Migration Service (classic). This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task.
create_or_updateinsertgroup_name, service_name, project_name, task_name, subscription_idCreate or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.
updateupdategroup_name, service_name, project_name, task_name, subscription_idCreate or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so.
create_or_updatereplacegroup_name, service_name, project_name, task_name, subscription_idCreate or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.
deletedeletegroup_name, service_name, project_name, task_name, subscription_iddeleteRunningTasksDelete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The DELETE method deletes a task, canceling it first if it's running.
cancelexecgroup_name, service_name, project_name, task_name, subscription_idCancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method cancels a task if it's currently queued or running.
commandexecgroup_name, service_name, project_name, task_name, subscription_id, commandTypeExecute a command on a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method executes a command on a running task.

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
group_namestringName of the resource group. Required.
project_namestringName of the project. Required.
service_namestringName of the service. Required.
subscription_idstring
task_namestringName of the Task. Required.
$expandstringExpand the response. Default value is None.
deleteRunningTasksbooleanDelete the resource even if it contains running tasks. Default value is None.
taskTypestringFilter tasks by task type. Default value is None.

SELECT examples

Get task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The GET method retrieves information about a task.

SELECT
id,
name,
clientData,
commands,
errors,
etag,
state,
systemData,
taskType,
type
FROM azure.data_migration.tasks
WHERE group_name = '{{ group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND task_name = '{{ task_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.

INSERT INTO azure.data_migration.tasks (
properties,
etag,
group_name,
service_name,
project_name,
task_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ etag }}',
'{{ group_name }}',
'{{ service_name }}',
'{{ project_name }}',
'{{ task_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

UPDATE examples

Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so.

UPDATE azure.data_migration.tasks
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

REPLACE examples

Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.

REPLACE azure.data_migration.tasks
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

DELETE examples

Delete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The DELETE method deletes a task, canceling it first if it's running.

DELETE FROM azure.data_migration.tasks
WHERE group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND deleteRunningTasks = '{{ deleteRunningTasks }}'
;

Lifecycle Methods

Cancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method cancels a task if it's currently queued or running.

EXEC azure.data_migration.tasks.cancel 
@group_name='{{ group_name }}' --required,
@service_name='{{ service_name }}' --required,
@project_name='{{ project_name }}' --required,
@task_name='{{ task_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;