Editar

Compartilhar via


Get-AzDataMigrationToSqlVM

Retrieve the specified database migration for a given SQL VM.

Syntax

Get-AzDataMigrationToSqlVM
   -ResourceGroupName <String>
   -SqlVirtualMachineName <String>
   [-SubscriptionId <String[]>]
   -TargetDbName <String>
   [-Expand <String>]
   [-MigrationOperationId <String>]
   [-DefaultProfile <PSObject>]
   [-PassThru]
   [<CommonParameters>]
Get-AzDataMigrationToSqlVM
   -InputObject <IDataMigrationIdentity>
   [-Expand <String>]
   [-MigrationOperationId <String>]
   [-DefaultProfile <PSObject>]
   [-PassThru]
   [<CommonParameters>]

Description

Retrieve the specified database migration for a given SQL VM.

Examples

Example 1: Get the details of a given Database Migration to a SQL Virtual Machine

Get-AzDataMigrationToSqlVM -ResourceGroupName "MyResourceGroup" -SqlVirtualMachineName "MySqlVM" -TargetDbName "MyDatabase"

Name                 Type                                       Kind  ProvisioningState MigrationStatus
----                 ----                                       ----  ----------------- ---------------
MyDatabase           Microsoft.DataMigration/databaseMigrations SqlVm Succeeded         Succeeded

This command gets the details of a given Database Migration to a SQL Virtual Machine.

Example 2: Get the expanded details of a given Database Migration to a SQL Virtual Machine

$vmMigration = Get-AzDataMigrationToSqlVM -ResourceGroupName "MyResouceGroup" -SqlVirtualMachineName "MySqlVM" -TargetDbName "MyDatabase" -Expand MigrationStatusDetails
$vmMigration.MigrationStatusDetail

BlobContainerName                    CompleteRestoreErrorMessage CurrentRestoringFilename          FileUploadBlockingError 
-----------------                    --------------------------- ------------------------          ----------------------- 
2673894b-451c-41cv-ae2b-58a8eefe3546                             AdventureWorks.bak

This command gets the expanded details of a given Database Migration to a SQL Virtual Machine.

Parameters

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Expand

Complete migration details be included in the response.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IDataMigrationIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-MigrationOperationId

Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Returns true when the command succeeds

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SqlVirtualMachineName

.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

Subscription ID that identifies an Azure subscription.

Type:String[]
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetDbName

The name of the target database.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IDataMigrationIdentity

Outputs

IDatabaseMigrationSqlVM