Cross-subscription support for SQL MI database copy and move – GA refresh!

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

Today I’d like to announce the refresh of database copy and move functionality. This refresh is brining support for cross-subscription copy and move operations within an Azure tenant. This means that if you are using multiple subscriptions under the same Azure tenant and are hosting multiple SQL Managed Instances under those subscriptions, now you can perform online, cross-instance database copy and move operations across all instances under the same tenant.

 

This is especially useful for those who are separating test and production environments with different subscriptions. Now, you will be able to promote a prepared database in test environment to your production subscription and environment, or to bring your production database to your test subscription to thoroughly investigate a new query performance regression.

 

How to perform cross-subscription copy and move operations?

 

Cross-subscriptions are supported with all standard interfaces, meaning via Azure portal, Azure PowerShell and CLI and REST API.

To start the operation via Azure Portal, you just go through the standard flow and on the destination details tab choose the Azure subscription.

 

cross-sub-db-copy-1.png

 

Once the cross-subscription copy or move operation is completed, you will see the details of the operation, like in the example below.

 

cross-sub-db-copy-2.png

 

And the same can be automated with scripts. Here’s an example of Az.Sql PowerShell.

 

 

 

Copy-AzSqlInstanceDatabase -DatabaseName 'db_copy_102' -InstanceName 'sqlmi001' -ResourceGroupName 'resourceGroup1' -TargetResourceGroupName 'resourceGroup2' -TargetInstanceName 'sqlmi002'

## Wait for the operation to be ready for completion.

Complete-AzSqlInstanceDatabaseCopy -DatabaseName 'db_copy_102' -InstanceName 'sqlmi001' -ResourceGroupName 'resourceGroup1' -TargetResourceGroupName 'resourceGroup2' -TargetInstanceName 'sqlmi002'

 

 

 

That’s right – with Az.Sql you don’t even specify the source and target subscriptions – the backend will find them for you.

 

Recommended content

 

Documentation for Azure SQL Managed Instance database copy and move operations.

GA of database copy and move for Azure SQL Managed Instance.

Azure PowerShell for database copy and move.

DEMO VIDEO for database copy and move.

 

Wrap-up

 

I think this would be it for 2023. This was a great year for SQL MI!

I wish you happy holidays, and I’m looking forward to a great year ahead of us and a number of great SQL MI announcements that will come in 2024!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.