Automate Azure SQL dB refresh from Prod to UAT

  • Hello folks,

    We’ve a requirement to refresh Azure sql dB UAT environment from prod on a regular basis. I see we can use export dB functionality and use Azure automation feature to automate. Anyone has a working PowerShell script to do this. Or any other options. Thanks in advance!

  • The way I'd do it is to create a copy of the production database, then export that to a BACPAC. The reason to do two steps is because the BACPAC creation process is not transaction aware. Creating the database copy ensures that no active transactions will interfere with the processing. To this you'll need two, easily found, PowerShell commands. Then, recreate the UAT environment from the BACPAC.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hello Grant, thanks for the response. Does a direct import create some kind of blocking in the database?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply