question

dpaisig-6233 avatar image
1 Vote"
dpaisig-6233 asked ·

Azure SQL Database refresh from Production to development

I'm starting to understand the Webapps for my sites, but need information on Azure SQL Database. If I have a DEV/QA/UAT/PRD environment, would I need 4 databases? Or is there a swapping functionality of that?

And how do I bring the database from PRD to replace DEV/QA/UAT? (IE refresh the lower environments with PRD data)

azure-sql-database
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlbertoMorillo avatar image
0 Votes"
AlbertoMorillo answered ·

You can drop the specific database for the DEV/QA/UAT/PRD environment. Then you can use PowerShell, the portal or T-SQL to create a copy of the production database.

You can use PowerShell as shown below:

 New-AzureRmSqlDatabaseCopy -ResourceGroupName "myResourceGroup" `
     -ServerName $sourceserver `
     -DatabaseName "MySampleDatabase" `
     -CopyResourceGroupName "myResourceGroup" `
     -CopyServerName $targetserver `
     -CopyDatabaseName "CopyOfMySampleDatabase"

You can use T-SQL as shown below:

 CREATE DATABASE db_copy   
     AS COPY OF ozabzw7545.db_original ( SERVICE_OBJECTIVE = 'S6' );

You can schedule to refresh your environments using PowerShell/T-SQL and Azure Automation account.










·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.