Forum Discussion
Azure VM can't connect to FileShare
If the share works when the storage account allows all networks, the storage key and share itself are probably fine. The problem is most likely the storage firewall path.
For an Azure VM, do not rely only on adding the VM public IP to the storage account firewall. Use one of these patterns instead:
1. Enable the Microsoft.Storage service endpoint on the VM subnet and add that subnet to the storage account network rules.
2. Or create a private endpoint for the file subresource and make sure private DNS resolves the storage file endpoint to the private IP.
3. If the VM is in another subscription or tenant, configure the VNet rule with CLI/PowerShell if the portal cannot select it, or use a private endpoint.
Also verify outbound TCP 445 from the VM, NSGs, local Windows firewall, and any corporate firewall/NVA. If open network access works but selected networks fails, focus on service endpoint/private endpoint/DNS rather than the access key.