AutoMount Azure Storage Account in Windows VM

Harshit Yadav
Jul 31, 2023

--

Full Article without paywall : harshityadav.in

To let the FileShare connection script be autorun at the start of the virtual machine instance and the fileshare be mounted using the same drive letter in VMSS where Talend is deployed

  1. Create the file named script.ps1 in the following folder location
C:\Users\<USER>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  1. With its content as the connection script provided by azure for mounting FileShare, go to the Azure file storage account
  1. In the Same folder create a file startup.bat with the following code
@ECHO OFF
Powershell.exe -executionpolicy bypass -File .\script.ps1

And Done ! on every VM or Windows Machine Restart your Storage Account will be Mounted as Z: drive in your OS as the Shell Script will be Auto Executed in Windows

--

--

Harshit Yadav
Harshit Yadav

Written by Harshit Yadav

Software Developer | Azure Solution Architect Expert | Technical Writer | harshityadav.in

No responses yet