问题
I successfully created and manually tested a share in Azure Files using instructions in this blog post. However, my deployed cloud service can't create a mount from C# or access the mount (create or list files) if I create it by remoting into the role.
回答1:
I was able to resolve this by calling map using the P/Invoke method explained here. The only trick was that I had to build the storage layer from source and updating the package references since it used a much older version of the Azure storage library.
If you're interested in what didn't work:
My first attempt was using a process and invoking 'cmd', but this failed completely I believe because of permissions, but I wasn't able to find out exactly why. My next attempt was a startup script to mount the drive. This resulted in a Disconnected drive that nothing could access even when I ran it with elevated permissions.
来源:https://stackoverflow.com/questions/28664358/accessing-mount-from-azure-files-in-cloud-service