An Azure relational database service.
Hello **Xhevahir Mehalla
**Moving a 30 GB Azure SQL Database between subscriptions in the same tenant is pretty straightforward—here’s a low-friction way to do it, plus how to carry over your users:
- Stand up your new logical SQL server in Subscription B:
• Give it the same server admin (either Azure AD or SQL Auth) as in Subscription A.
• Open the server firewall to allow Azure services (this makes the copy simpler). - Copy the UAT database:
Option A – T-SQL :
• Connect to the master database on your target server (in Sub B) and run below query,
sql CREATE DATABASE UAT AS COPY OF serverA-name.UAT (SERVICE_OBJECTIVE = YOUR_DESIRED_TIER);
Option B – PowerShell / Azure CLI / Portal:
• In PowerShell:
powershell New-AzSqlDatabaseCopy ` -ResourceGroupName RG-B ` -ServerName serverB-name ` -DatabaseName UAT ` -CopyResourceId "/subscriptions/{subA}/resourceGroups/RG-A/providers/Microsoft.Sql/servers/serverA-name/databases/UAT"
• Or use the Azure portal’s “Copy” button on the UAT DB blade, picking your server in Sub B.
- Migrate your logins/users:
• If you’re using Azure AD authentication, assigning the same AAD admin on the new server gives your users instant access (you’ll just need to re-grant any DB-level roles if needed).
• For SQL Auth logins, script them out on the old server with a routine likesp_help_revlogin(which preserves SIDs/password hashes) and run that script on the new server so the database users map correctly. - Validate & cleanup:
• Test connectivity from your apps or SSMS.
• Once all’s green, you can drop the old UAT copy or keep it around as a fallback.
Hope that helps.
https://learn.microsoft.com/en-us/azure/azure-sql/database/database-copy?view=azuresql&tabs=azure-portal#copy-to-a-different-subscription
https://learn.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current&preserve-view=true&tabs=sqlpool#copy-a-database
https://learn.microsoft.com/en-us/azure/azure-sql/database/database-copy?view=azuresql&tabs=azure-portal#copy-a-database