%3CLINGO-SUB%20id%3D%22lingo-sub-1067624%22%20slang%3D%22en-US%22%3EHow%20to%20refresh%20database%20staging%20environments%20for%20Azure%20Synapse%20Analytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1067624%22%20slang%3D%22en-US%22%3E%3CP%3EIt%E2%80%99s%20common%20for%20large%20data%20analytics%20solutions%20to%20have%20multiple%20staging%20environments%20such%20as%20development%2C%20testing%2C%20and%20quality%20assurance%20to%20ensure%20stable%20feature%20releases%20to%20production.%20When%20using%20SQL%20analytics%20capabilities%20within%20Azure%20Synapse%20Analytics%20(formerly%20known%20as%20SQL%20Data%20Warehouse)%2C%20it%E2%80%99s%20recommended%20to%20decouple%20these%20environments%20in%20separate%20databases%20to%20ensure%20these%20environments%20do%20not%20impact%20one%20another%20and%20periodically%20refresh%20these%20staging%20environments%20with%20production%20data.%20Oftentimes%20this%20refresh%20can%20be%20simply%20achieved%20through%20the%20database%20backup%20and%20restore%20capabilities%20which%20can%20be%20done%20cross%20or%20in-place%20a%20logical%20SQL%20Server.%20Many%20developers%20have%20multiple%20subscriptions%20or%20resource%20groups%20hosting%20each%20of%20these%20environments%20and%20would%20like%20to%20also%20refresh%20by%20restoring%20environments%20across%20these%20two%20boundaries.%20This%20blog%20outlines%20how%20to%20simply%20refresh%20and%20sync%20your%20staging%20environments%20with%20production%20data%20when%20environments%20reside%20in%20different%20Azure%20subscriptions%20or%20resource%20group.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Navigate%20to%20the%20portal%20of%20your%20SQL%20pool%20and%20create%20a%20database%20restore%20point%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22clipboard_image_0.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F161917i0C5E7539B2DF42A0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22clipboard_image_0.png%22%20alt%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Initiate%20a%20cross%20server%20restore%20using%20the%20newly%20created%20restore%20point%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22clipboard_image_0.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F161914iD803D076D19F4C0A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22clipboard_image_0.png%22%20alt%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Navigate%20to%20the%20logical%20server%20of%20your%20newly%20restored%20data%20warehouse%20and%20select%20the%20Move%20operation%20in%20the%20command%20bar%20of%20your%20logical%20server.%20Note%20the%20Move%20capability%20is%20only%20available%20at%20the%20logical%20server%20level%20which%20will%20move%20all%20databases%20under%20your%20server.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22clipboard_image_2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F161910i471E33DB87D34B26%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22clipboard_image_2.png%22%20alt%3D%22clipboard_image_2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20process%20can%20be%20operationalized%20and%20automated%20in%20Azure%20DevOps%20leveraging%20PowerShell.%20Documenation%20links%20can%20be%20found%20here%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsql-data-warehouse%2Fsql-data-warehouse-restore-points%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECreate%20a%20user-defined%20restore%20point%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsql-data-warehouse%2Fsql-data-warehouse-restore-active-paused-dw%23restore-an-existing-data-warehouse-through-powershell%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERestore%20the%20database%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpowershell%2Fmodule%2Fazurerm.resources%2Fmove-azurermresource%3Fview%3Dazurermps-6.13.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMove%20azure%20resources%20across%20subscriptions%20or%20resource%20groups%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1067624%22%20slang%3D%22en-US%22%3E%3CP%3ERefresh%20database%20staging%20environments%20across%20multiple%20Azure%20subscriptions%20or%20resource%20groups%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1067624%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESynapse%20DevOps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESynapse%20SQL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

It’s common for large data analytics solutions to have multiple staging environments such as development, testing, and quality assurance to ensure stable feature releases to production. When using SQL analytics capabilities within Azure Synapse Analytics (formerly known as SQL Data Warehouse), it’s recommended to decouple these environments in separate databases to ensure these environments do not impact one another and periodically refresh these staging environments with production data. Oftentimes this refresh can be simply achieved through the database backup and restore capabilities which can be done cross or in-place a logical SQL Server. Many developers have multiple subscriptions or resource groups hosting each of these environments and would like to also refresh by restoring environments across these two boundaries. This blog outlines how to simply refresh and sync your staging environments with production data when environments reside in different Azure subscriptions or resource group.

 

1. Navigate to the portal of your SQL pool and create a database restore point

clipboard_image_0.png

 

2. Initiate a cross server restore using the newly created restore pointclipboard_image_0.png

 

 

3. Navigate to the logical server of your newly restored data warehouse and select the Move operation in the command bar of your logical server. Note the Move capability is only available at the logical server level which will move all databases under your server.

clipboard_image_2.png

 

 

This process can be operationalized and automated in Azure DevOps leveraging PowerShell. Documenation links can be found here: