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.
Once the cross-subscription copy or move operation is completed, you will see the details of the operation, like in the example below.
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!