Yes, you can Copy the SQL database with encryption from one Azure subscription to another. But you have to move your database along with an Azure SQL Server. Not just the database itself. You can follow my steps as a workaround.
I tested this successfully with the following steps:
- Subscription 1 Create a new resource group, an Azure SQL Server and Azure SQL database which is empty.
Create a certificate and symmetric key. Example from Microsoft documentation. Certificate and Symmetric key.
CREATE CERTIFICATE Shipping04
ENCRYPTION BY PASSWORD = 'pGFD4bb925DGvbd2439587y'
WITH SUBJECT = 'Sammamish Shipping Records',
EXPIRY_DATE = '20201031';
GO
CREATE SYMMETRIC KEY JanainaKey09
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE Shipping04;
GO
Create another resource group in the same subscription as the staging area. Create a new Azure SQL Server and copy the database once the backup is available. You need this because when you move the resource they will not available at source after the move.
Restore-AzSqlDatabase `
-FromPointInTimeBackup `
-PointInTime (Get-Date).AddMinutes(-10) `
-ResourceGroupName $Database.ResourceGroupName `
-ServerName $secondaryServerName `
-TargetDatabaseName $secondarydatabaseName `
-ResourceId $Database.ResourceID `
-Edition "Premium" `
-ServiceObjectiveName "P1" }
- Move Azure SQL Server and refreshed database to a different subscription. You can move to an existing resource group and create a new one. Use
Move-AzResource
command. Details here and here.
- Now copy the database to your existing SQL Server.
- Delete the resources in step 4.
If you try to move only the database this the error message you get.
"properties": {
"statusCode": "BadRequest",
"serviceRequestId": null,
"statusMessage": "{\"error\":{\"code\":\"InvalidResourceMoveRequest\",\"message\":\"The list of resources in move definition cannot be null or empty.\"}}"
},