How to store scripts folders on Azure Files
Last modified: July 4, 2024
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
- Create an Azure Files account
- Mount the Azure file share on Windows
- Move the scripts folder to Microsoft Azure Files
- Compare and synchronize a scripts folder stored on Azure Files with a live database
Create an Azure Files account
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.
Mount the Azure file share on Windows
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.
Move the scripts folder to Microsoft Azure Files
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.
Compare and synchronize a scripts folder stored on Azure Files with a live database
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.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by Schema Compare for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.