Skip to content

Commit 77db2d5

Browse files
gansachgansach
andauthored
docs(datamigration): add examples for New-AzDataMigrationToSqlManagedInstance cmdlet (Azure#27836)
Co-authored-by: gansach <[email protected]>
1 parent 887ebd0 commit 77db2d5

File tree

6 files changed

+148
-20
lines changed

6 files changed

+148
-20
lines changed

src/DataMigration/DataMigration.Autorest/docs/New-AzDataMigrationToSqlManagedInstance.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,51 @@ This command starts a Database Migration from the Source Sql Server to target Ma
4949
This example is for online migration.
5050
To make it offline add -Offline to the parameters.
5151

52+
### Example 2: Start DB Migration from Azure Blob to Managed Instance via System-Assigned Identity
53+
```powershell
54+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "SystemAssigned" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
55+
```
56+
57+
```output
58+
Name Type Kind ProvisioningState MigrationStatus
59+
---- ---- ---- ----------------- ---------------
60+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
61+
```
62+
63+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
64+
This example is for online migration.
65+
To make it offline add -Offline to the parameters.
66+
67+
### Example 3: Start DB Migration from Azure Blob to Managed Instance via User-Assigned Identity
68+
```powershell
69+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "UserAssigned" -AzureBlobUserAssignedIdentity "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyUserAssignedIdentity" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
70+
```
71+
72+
```output
73+
Name Type Kind ProvisioningState MigrationStatus
74+
---- ---- ---- ----------------- ---------------
75+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
76+
```
77+
78+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
79+
This example is for online migration.
80+
To make it offline add -Offline to the parameters.
81+
82+
### Example 4: Start DB Migration from Azure Blob to Managed Instance via Storage Account Key
83+
```powershell
84+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container" -AzureBlobAccountKey "accountKey"
85+
```
86+
87+
```output
88+
Name Type Kind ProvisioningState MigrationStatus
89+
---- ---- ---- ----------------- ---------------
90+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
91+
```
92+
93+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
94+
This example is for online migration.
95+
To make it offline add -Offline to the parameters.
96+
5297
## PARAMETERS
5398

5499
### -AsJob

src/DataMigration/DataMigration.Autorest/examples/New-AzDataMigrationToSqlManagedInstance.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,41 @@ MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded
1313

1414
This command starts a Database Migration from the Source Sql Server to target Managed Instance. This example is for online migration. To make it offline add -Offline to the parameters.
1515

16+
### Example 2: Start DB Migration from Azure Blob to Managed Instance via System-Assigned Identity
17+
```powershell
18+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "SystemAssigned" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
19+
```
20+
21+
```output
22+
Name Type Kind ProvisioningState MigrationStatus
23+
---- ---- ---- ----------------- ---------------
24+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
25+
```
26+
27+
This command starts a Database Migration from the Azure Blob to target Managed Instance. This example is for online migration. To make it offline add -Offline to the parameters.
28+
29+
### Example 3: Start DB Migration from Azure Blob to Managed Instance via User-Assigned Identity
30+
```powershell
31+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "UserAssigned" -AzureBlobUserAssignedIdentity "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyUserAssignedIdentity" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
32+
```
33+
34+
```output
35+
Name Type Kind ProvisioningState MigrationStatus
36+
---- ---- ---- ----------------- ---------------
37+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
38+
```
39+
40+
This command starts a Database Migration from the Azure Blob to target Managed Instance. This example is for online migration. To make it offline add -Offline to the parameters.
41+
42+
### Example 4: Start DB Migration from Azure Blob to Managed Instance via Storage Account Key
43+
```powershell
44+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container" -AzureBlobAccountKey "accountKey"
45+
```
46+
47+
```output
48+
Name Type Kind ProvisioningState MigrationStatus
49+
---- ---- ---- ----------------- ---------------
50+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
51+
```
1652

53+
This command starts a Database Migration from the Azure Blob to target Managed Instance. This example is for online migration. To make it offline add -Offline to the parameters.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "1051dcfe-079d-4e3d-8a48-42fe1e5ad7f5"
2+
"generate_Id": "3d863b05-0047-489c-b7f2-6b7dfd14dd0a"
33
}

src/DataMigration/DataMigration.sln

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataMigration.Management.Sd
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataMigration.Autorest", "DataMigration.Autorest", "{99C2544C-AB42-E787-839D-5E95A7719D6A}"
3131
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataMigration", "..\..\generated\DataMigration\DataMigration.Autorest\Az.DataMigration.csproj", "{C95F4F91-3894-44F3-9367-328477EB908E}"
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataMigration", "..\..\generated\DataMigration\DataMigration.Autorest\Az.DataMigration.csproj", "{398126D4-ED35-4BA1-AC6D-919AF44A8C72}"
3333
EndProject
3434
Global
3535
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -161,18 +161,18 @@ Global
161161
{F2182D2E-3C99-4294-ACCA-D081A4ABA49E}.Release|x64.Build.0 = Release|Any CPU
162162
{F2182D2E-3C99-4294-ACCA-D081A4ABA49E}.Release|x86.ActiveCfg = Release|Any CPU
163163
{F2182D2E-3C99-4294-ACCA-D081A4ABA49E}.Release|x86.Build.0 = Release|Any CPU
164-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
165-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|Any CPU.Build.0 = Debug|Any CPU
166-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|x64.ActiveCfg = Debug|Any CPU
167-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|x64.Build.0 = Debug|Any CPU
168-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|x86.ActiveCfg = Debug|Any CPU
169-
{C95F4F91-3894-44F3-9367-328477EB908E}.Debug|x86.Build.0 = Debug|Any CPU
170-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|Any CPU.ActiveCfg = Release|Any CPU
171-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|Any CPU.Build.0 = Release|Any CPU
172-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|x64.ActiveCfg = Release|Any CPU
173-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|x64.Build.0 = Release|Any CPU
174-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|x86.ActiveCfg = Release|Any CPU
175-
{C95F4F91-3894-44F3-9367-328477EB908E}.Release|x86.Build.0 = Release|Any CPU
164+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
165+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|Any CPU.Build.0 = Debug|Any CPU
166+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|x64.ActiveCfg = Debug|Any CPU
167+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|x64.Build.0 = Debug|Any CPU
168+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|x86.ActiveCfg = Debug|Any CPU
169+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Debug|x86.Build.0 = Debug|Any CPU
170+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|Any CPU.ActiveCfg = Release|Any CPU
171+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|Any CPU.Build.0 = Release|Any CPU
172+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|x64.ActiveCfg = Release|Any CPU
173+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|x64.Build.0 = Release|Any CPU
174+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|x86.ActiveCfg = Release|Any CPU
175+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72}.Release|x86.Build.0 = Release|Any CPU
176176
EndGlobalSection
177177
GlobalSection(SolutionProperties) = preSolution
178178
HideSolutionNode = FALSE
@@ -186,7 +186,7 @@ Global
186186
{50E89024-F7A8-43B9-90E7-7EF9BA0E0153} = {7D1B97D0-9BDC-424D-830B-8F18FF10B2E5}
187187
{ED4B7E88-440B-42EA-B412-54EE0ABACC6E} = {06363AEF-5C97-42F6-9AFD-4296138F8494}
188188
{6900ED56-82F6-41C5-A00A-1F5B5228BE67} = {06363AEF-5C97-42F6-9AFD-4296138F8494}
189-
{C95F4F91-3894-44F3-9367-328477EB908E} = {99C2544C-AB42-E787-839D-5E95A7719D6A}
189+
{398126D4-ED35-4BA1-AC6D-919AF44A8C72} = {99C2544C-AB42-E787-839D-5E95A7719D6A}
190190
EndGlobalSection
191191
GlobalSection(ExtensibilityGlobals) = postSolution
192192
SolutionGuid = {FFFD82C2-1828-47A7-AF4A-6678F0E0C27B}

src/DataMigration/DataMigration/Az.DataMigration.psd1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 5/14/2025
6+
# Generated on: 26-05-2025
77
#
88

99
@{
@@ -60,10 +60,10 @@ RequiredAssemblies = 'DataMigration.Autorest/bin/Az.DataMigration.private.dll',
6060
'Microsoft.Azure.PowerShell.DataMigration.Management.Sdk.dll'
6161

6262
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
63-
# ScriptsToProcess = @()
63+
ScriptsToProcess = @()
6464

6565
# Type files (.ps1xml) to be loaded when importing this module
66-
# TypesToProcess = @()
66+
TypesToProcess = @()
6767

6868
# Format files (.ps1xml) to be loaded when importing this module
6969
FormatsToProcess = 'DataMigration.Autorest/Az.DataMigration.format.ps1xml'
@@ -147,7 +147,8 @@ PrivateData = @{
147147
PSData = @{
148148

149149
# Tags applied to this module. These help with module discovery in online galleries.
150-
Tags = 'Azure','ResourceManager','ARM','Sql','Database','Data','Migration','Service'
150+
Tags = 'Azure', 'ResourceManager', 'ARM', 'Sql', 'Database', 'Data', 'Migration',
151+
'Service'
151152

152153
# A URL to the license for this module.
153154
LicenseUri = 'https://aka.ms/azps-license'
@@ -174,7 +175,7 @@ PrivateData = @{
174175

175176
} # End of PSData hashtable
176177

177-
} # End of PrivateData hashtable
178+
} # End of PrivateData hashtable
178179

179180
# HelpInfo URI of this module
180181
# HelpInfoURI = ''

src/DataMigration/DataMigration/help/New-AzDataMigrationToSqlManagedInstance.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,51 @@ This command starts a Database Migration from the Source Sql Server to target Ma
4949
This example is for online migration.
5050
To make it offline add -Offline to the parameters.
5151

52+
### Example 2: Start DB Migration from Azure Blob to Managed Instance via System-Assigned Identity
53+
```powershell
54+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "SystemAssigned" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
55+
```
56+
57+
```output
58+
Name Type Kind ProvisioningState MigrationStatus
59+
---- ---- ---- ----------------- ---------------
60+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
61+
```
62+
63+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
64+
This example is for online migration.
65+
To make it offline add -Offline to the parameters.
66+
67+
### Example 3: Start DB Migration from Azure Blob to Managed Instance via User-Assigned Identity
68+
```powershell
69+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobAuthType "ManagedIdentity" -AzureBlobIdentityType "UserAssigned" -AzureBlobUserAssignedIdentity "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyUserAssignedIdentity" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container"
70+
```
71+
72+
```output
73+
Name Type Kind ProvisioningState MigrationStatus
74+
---- ---- ---- ----------------- ---------------
75+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
76+
```
77+
78+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
79+
This example is for online migration.
80+
To make it offline add -Offline to the parameters.
81+
82+
### Example 4: Start DB Migration from Azure Blob to Managed Instance via Storage Account Key
83+
```powershell
84+
New-AzDataMigrationToSqlManagedInstance -ResourceGroupName "MyResourceGroup" -ManagedInstanceName "MyManagedInstance" -TargetDbName "MyDb" -Kind "SqlMI" -Scope "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/managedInstances/MyManagedInstance" -MigrationService "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyRG/providers/Microsoft.DataMigration/SqlMigrationServices/MySqlMigrationService" -AzureBlobStorageAccountResourceId "/subscriptions/0000-1111-2222-3333-4444/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount" -AzureBlobContainerName "container" -AzureBlobAccountKey "accountKey"
85+
```
86+
87+
```output
88+
Name Type Kind ProvisioningState MigrationStatus
89+
---- ---- ---- ----------------- ---------------
90+
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
91+
```
92+
93+
This command starts a Database Migration from the Azure Blob to target Managed Instance.
94+
This example is for online migration.
95+
To make it offline add -Offline to the parameters.
96+
5297
## PARAMETERS
5398

5499
### -AsJob

0 commit comments

Comments
 (0)