Skip to content

feat(datamigration): add support for blob to Sql MI identity migrations #27621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<copyright>Microsoft Corporation. All rights reserved.</copyright>
<tags>Azure ResourceManager ARM PSModule $(service-name)</tags>
<dependencies>
<dependency id="Az.Accounts" version="2.2.3" />
<dependency id="Az.Accounts" version="2.7.5" />
</dependencies>
</metadata>
<files>
Expand All @@ -23,9 +23,9 @@
<!-- https://github.com/NuGet/Home/issues/3584 -->
<file src="bin/Az.DataMigration.private.dll" target="bin" />
<file src="bin\Az.DataMigration.private.deps.json" target="bin" />
<file src="internal\**\*.*" exclude="internal\readme.md" target="internal" />
<file src="custom\**\*.*" exclude="custom\readme.md;custom\**\*.cs" target="custom" />
<file src="docs\**\*.md" exclude="docs\readme.md" target="docs" />
<file src="internal\**\*.*" exclude="internal\README.md" target="internal" />
<file src="custom\**\*.*" exclude="custom\README.md;custom\**\*.cs" target="custom" />
<file src="docs\**\*.md" exclude="docs\README.md" target="docs" />
<file src="exports\**\ProxyCmdletDefinitions.ps1" target="exports" />
<file src="utils\**\*.*" target="utils" />
</files>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "sqlMigrationServices",
"apiVersion": "2022-03-30-preview",
"apiVersion": "2025-03-15-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.datamigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.ISqlMigrationService

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IAuthenticationKeys

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IIntegrationRuntimeMonitoringData

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigration

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlDb

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlMi

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlVM

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.ISqlMigrationService

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IRegenAuthKeys

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Accept wildcard characters: False
```

### -Scope
Resource Id of the target resource (SQL VM or SQL Managed Instance)
Resource Id of the target resource.

```yaml
Type: System.String
Expand Down Expand Up @@ -496,7 +496,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlDb

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ Create a new database migration to a given SQL Managed Instance.
```
New-AzDataMigrationToSqlManagedInstance -ManagedInstanceName <String> -ResourceGroupName <String>
-TargetDbName <String> [-SubscriptionId <String>] [-AzureBlobAccountKey <String>]
[-AzureBlobContainerName <String>] [-AzureBlobStorageAccountResourceId <String>]
[-FileSharePassword <SecureString>] [-FileSharePath <String>] [-FileShareUsername <String>]
[-Kind <ResourceType>] [-MigrationService <String>] [-Offline] [-OfflineConfigurationLastBackupName <String>]
[-Scope <String>] [-SourceDatabaseName <String>] [-SourceSqlConnectionAuthentication <String>]
[-SourceSqlConnectionDataSource <String>] [-SourceSqlConnectionEncryptConnection]
[-SourceSqlConnectionPassword <SecureString>] [-SourceSqlConnectionTrustServerCertificate]
[-SourceSqlConnectionUserName <String>] [-StorageAccountKey <String>] [-StorageAccountResourceId <String>]
[-TargetDatabaseCollation <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm]
[-WhatIf] [<CommonParameters>]
[-AzureBlobAuthType <AuthType>] [-AzureBlobContainerName <String>]
[-AzureBlobStorageAccountResourceId <String>] [-FileSharePassword <SecureString>] [-FileSharePath <String>]
[-FileShareUsername <String>] [-IdentityType <ManagedServiceIdentityType>]
[-IdentityUserAssignedIdentity <Hashtable>] [-Kind <ResourceType>] [-MigrationService <String>] [-Offline]
[-OfflineConfigurationLastBackupName <String>] [-Scope <String>] [-SourceDatabaseName <String>]
[-SourceSqlConnectionAuthentication <String>] [-SourceSqlConnectionDataSource <String>]
[-SourceSqlConnectionEncryptConnection] [-SourceSqlConnectionPassword <SecureString>]
[-SourceSqlConnectionTrustServerCertificate] [-SourceSqlConnectionUserName <String>]
[-StorageAccountKey <String>] [-StorageAccountResourceId <String>] [-TargetDatabaseCollation <String>]
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -80,6 +81,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -AzureBlobAuthType
Authentication type used for accessing Azure Blob Storage.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthType
Parameter Sets: (All)
Aliases:

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

### -AzureBlobContainerName
Blob container name where backups are stored.

Expand Down Expand Up @@ -171,6 +187,38 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -IdentityType
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ManagedServiceIdentityType
Parameter Sets: (All)
Aliases:

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

### -IdentityUserAssignedIdentity
The set of user assigned identities associated with the resource.
The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
The dictionary values can be empty objects ({}) in requests.

```yaml
Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:

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

### -Kind
.

Expand Down Expand Up @@ -295,7 +343,7 @@ Accept wildcard characters: False
```

### -Scope
Resource Id of the target resource (SQL VM or SQL Managed Instance)
Resource Id of the target resource (SQL Managed Instance).

```yaml
Type: System.String
Expand Down Expand Up @@ -527,7 +575,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlMi

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDatabaseMigrationSqlVM

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.IDeleteNode

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService
### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20250315Preview.ISqlMigrationService

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,44 @@ MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded

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.

### Example 2: Start a Database Migration from Azure Blob to target Managed Instance using target's SystemAssigned Managed Identity

```powershell
TODO
```

```output
Name Type Kind ProvisioningState MigrationStatus
---- ---- ---- ----------------- ---------------
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
```

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.

### Example 3: Start a Database Migration from Azure Blob to target Managed Instance using a User Assigned Managed Identity

```powershell
TODO
```

```output
Name Type Kind ProvisioningState MigrationStatus
---- ---- ---- ----------------- ---------------
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
```

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.

### Example 4: Start a Database Migration from Azure Blob to target Managed Instance using the Storage Account Key

```powershell
TODO
```

```output
Name Type Kind ProvisioningState MigrationStatus
---- ---- ---- ----------------- ---------------
MyDb Microsoft.DataMigration/databaseMigrations SqlMi Succeeded InProgress
```

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.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlService'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlService.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlService.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName

Describe 'Get-AzDataMigrationSqlService' {
It 'List1' -skip {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlServiceAuthKey'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlServiceAuthKey.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlServiceAuthKey.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName

Describe 'Get-AzDataMigrationSqlServiceAuthKey' {
It 'List' -skip {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName

Describe 'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric' {
It 'List' -skip {
Expand Down
Loading