Prerequisites
Check Storage Account Networking
- Resource group > Select storage account
- Settings: Networking
- Allow access from: Selected netwok
- Check the subnet where Azure VM belongs is added
- Add Azure VM subnet if needed > Save (don’t forget to save)
- Allow access from: All network
- Check container access
- If container access is private, then attaching file share to VM might not work
Connecting file share
- Connect VM i.e. Windows VM using RDP
- Open PowerShell
- Go to resource groups: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group > select storage account
- File service > File shares > Select target file share
- Connect > copy PowerShell command
- Paste command in VM PowerShell
- Now check VM drives > file share should show as drive