I have a Windows 2012R2 VM in Azure. I have created an Azure FileShare in my Azure Storage Account.
I need to create a Mapped Network Drive on my VM which makes my FileShare available to a Windows Service that is running as the "Local System" User.
I have managed to use the following article to create a Persistent Mapped Network Drive to my Azure FileShare.
This works ok, and does indeed survive OS restarts. As soon as the OS has "Cleanly shutdown and started again", the Mapped Drive does indeed appear for all Users and connects fine.
My issue is, that I also have an Azure Automation Task to Stop my VMs (Deallocated) every night, to save on costs. This is due to these particular VM's being developer test machines which are only used during the day.
When I Stop my VM's using Stop-AzureRmVm, when I start the VM again, my Network Drive is no longer mapped to my Azure FileShare, as in it does not even appear as a drive anymore.
I can only assume it is due to having its resources deallocated by Azure as an OS shutdown and start or restart, keeps the drive ok.
Can anyone give me any suggestions for surviving an Azure VM Power Off scenario, or suggest another way of tackling this issue?