This is a detailed step-by-step walkthrough on how to move a database scripts folder to an Azure Files storage and keep it up-to-date with the help of dbForge Schema Compare for SQL Server.
Let us consider the following scenario. We have a development database — AdventureWorks2019_Dev. We want to keep its scripts folder in Azure Cloud File Storage and regularly update it with the most recent changes.
Workflow
To use Azure Files, you need an active Azure account. If you don’t have an Azure account, go to the Azure website. In the upper right corner of the screen, click Free account and follow the standard instructions.
Now you can set up your Azure Files storage from your Azure account home page via Storage accounts under Azure services. To see how it’s done, refer to Quickstart: Create and use an Azure file share.
1. In File Explorer, go to This PC.
2. Select Map network drive from the shortcut menu.
3. In the Map Network Drive dialog that opens, specify the drive letter for the connection and provide the UNC path. The UNC path format is as follows:
\\<YourAccountName>.file.core.windows.net\<YourFileShareName>
In our case, the UNC path appears as follows:
\\dbfstoragetest.file.core.windows.net\testshare
Once done, click Finish.
4. In the Windows Security dialog that opens, enter your credentials to connect to the Azure Files share and click OK.
5. You are ready to use the Azure file share.
After you have mounted the Azure file share with File Explorer, simply copy the necessary scripts folder to the drive. In our working example, we are moving the AdventureWorks2019_SF database scripts folder to the Azure file share.
Check the Azure Files web console to verify that you have moved the scripts folder successfully.
In our scenario, we have a live development database and we want to sync our scripts folder that resides in the cloud with that database. The logic behind this is to regularly run schema and data comparison between the database and the scripts folder, and in case any differences are found — deploy them.
You can automate the process of schema comparison and synchronization by using the command line. Automation of data comparison and synchronization is also possible.
Note
You can similarly move your scripts folders to Azure Files in dbForge Studio for SQL Server. To learn how to do that, refer to our blog post How to Move Your Scripts Folders to Azure Files and Keep Them Up-to-Date.