Using the Azure File sharing service on Windows
As explained earlier, you can mount an azure file share locally as you would with a network drive through the SMB 3.0 protocol, but be aware of the different versions of Windows support for the SMB protocol:
How do I access shared file storage in Azure Windows virtual machines?
- Create a Windows 2012 virtual machine that can be stored in a region with your file share, for example in Beijing, or not in one area, one in the Beijing area and one in the Shanghai area
- Persist your access credentials, if you just mount the shared service manually, then after restarting, the system will not automatically reconnect, the way is to use Cmdkey, execute the following command:
cmdkey/add:<storage-account-name>. file.core.chinacloudapi.cn/user:<storage-account-name>/pass:<storage-account-key>
- Make sure that your above commands are successful, and then you can mount your Azure file sharing service to your drive using the net use command, such as:
net use <drive-letter>: \\<storage-account-name>.file.core.chinacloudapi.cn \<share-name>
例如在本测试示例中:
NET use F: \\mystorageacctfile.file.core.chinacloudapi.cn\myfileshare
Then you can access the shared storage as you would access the local drive disk
4. Restart the server, detect whether the shared service will automatically connect, you can see the system restarts, the file share directory is automatically loaded, and then we do a simple test, we create a test directory under the directory of Windows and test files Mywindows.txt:
5. Open PowerShell and use PowerShell to get a list of files under the file share, and you can see the new directories and files:
Can I mount the Azure file sharing service directly on the user's data center or on my own laptop? The answer is yes, the premise:
- Using a machine in your own datacenter to link to Azure's file sharing service, you must use SMB 3.0, so make sure your machine is in the SMB3.0 list, and I'm using Windows 10 in this test.
- SMB 3.0 must use port 445, in my test, some operators will block the port, causing the service to be inaccessible, not only in China, in other countries around the world, different operators will have similar situation, please test 445 port before testing
In this test, I used the China Telecom Broadband, my Windows 10 notebook, to successfully link to the Azure File sharing service and operate normally:
Note: If you have encountered the following error when using the net USE command:
System error occurred has.
so basically can be because of your Internet service provider, your Firewall or ISP will be 445 Port is blocked, please contact your administrator or operator, in the U.S. region of the various operators for 445 for the development of ports, please refer to:
http://social.technet.microsoft.com/wiki/contents/articles/32346. Azure-summary-of-isps-that-allow-disallow-access-from-port-445.aspx
Azure file SMB3.0 files sharing Service (3)