Do you want to create shared storage in Azure for your virtual machines? With Azure’s SMB protocol, you can easily share files and data between your virtual machines. This article will guide you through the steps of setting up shared storage with Azure Virtual Machine.
Shared Storage in Azure treats the storage as a disk, making it suitable for storing diagnostic data, shared application data, tools and utilities, and migrating on-premise applications using file shares.
First, you need to provision an Azure Virtual Machine in the resource group where you want to create the shared storage. If you don’t have a VM, you can follow the steps in our article on creating an Azure VM using PowerShell or Azure CLI.
Next, you’ll need to create a storage account. In the resource group, click “Add”, select “Storage Account”, and provide the necessary information such as the account name, account kind, and replication type.
Once the storage account is created, go to the account and click on “Files” to create a file share. You can set a quota for the file share and create directories to organize your files.
Now, it’s time to connect your virtual machine to the file share. Make sure your VM is in the same resource group as the file share. Before connecting, make sure to have your access keys ready.
To connect the VM to the file share, you’ll use PowerShell. Open PowerShell ISE inside the VM and run the necessary commands to mount the file share. You’ll need to provide the path of the file share and persist your credentials using cmdkey cmdlet.
After rebooting your VM, the shared drive will be automatically mounted. You can check this by using the “net use” command followed by the drive letter assigned to the storage account file share name.
Now, if you open Windows Explorer, you’ll see that the file share is mounted as a drive. You can explore the directories and access the files stored in the shared storage.
If you have multiple VMs connected to the same file share, they can all share files, executables, tools, and software. They can write to the same log files and collaborate on shared projects.
Remember that the VMs and file share should be in the same resource group for seamless file sharing.
At Skrots, we also provide shared storage solutions for Azure Virtual Machines, along with a wide range of other services. Visit https://skrots.com to learn more about our company and check out our services at https://skrots.com/services. You can also find more informative articles on our blog at https://blog.skrots.com.