Azure SQL Database
An Azure relational database service.
6,321 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Team, Automate backup and restore DB in Azure Db. The requirement is the everyday night we have to refresh DEV DB from PROD. So that our application team works on live DB. In SQL Server it is very easy to setup a SQL Agent job to perform this activity.
My suggestion is to do it using Azure Automation. Use PowerShell to make sure Dev database is dropped if it exists:
Get-AzureRmSqlDatabase -ResourceGroupName $ResourceGroupName -ServerName $SqlServerName -DatabaseName $databaseCopyNameRemove-AzureRmSqlDatabase -ResourceGroupName $ResourceGroupName -ServerName $SqlServerName-DatabaseName $databaseCopyName `-Force
After that create Dev database as a copy of Production.
New-AzureRmSqlDatabaseCopy -ResourceGroupName rg-resourcegroupname -ServerName sql-servername-Tags @{key="value"} -DatabaseName sqldb-databasename-CopyResourceGroupName rg-resourcegroupname -CopyServerName sql-servername-CopyDatabaseName sqldb-databasename-copy
This way refreshing the Dev environment is faster.