Azure Storage's File services

Source: Internet
Author: User

The Spring Festival before the surprise business trip a few times busy, did not want to go to work after the holiday ... Ah, but the full work arrangement will let oneself get faster promotion (only such self comfort), there is no update blog, mainly because of busy many pre-sales projects, but also slow to think of what is worth sharing content, the Chinese New Year use a few days to do some testing and prepared a lot of material, Some of the content may have been share recently, but many of them are basic and hopefully help some of the friends who have just come into contact with azure or cloud computing.


The previous blog post mentions something about Azure storage services, such as the concept of blobs, and a new service like the Azcopy management tool that continues today on Azure storage, called Azure file services.


Take a look at the following two graphs, relative to the Blob, file services (that is, fileshare) logically look at some differences, the first is also based on the concept of storage account, that is, the opening of the URL and blob, Table, queue is the same, Only after storing the account is no longer container but share, this share equivalent to the share name (no quantity limit), and our Windows Server is the same as the SMB share, However, the Azure file service is based on smb2.1 instead of 3.0, which means that the current file service can not host virtual machines or MSSQL these services, after share is the directory, the directory is also no limit, the final file, the maximum size of a single file is 1TB, you can find this threshold and page BLOBs are the same.


Then the URL format for the final Azure file service is: https:// <storageaccount> . file.core.chinacloudapi.cn/ <share> / <directory/directories> /<file>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D2/wKioL1T9uIGxUcZnAADUyClJzOc452.jpg "style=" float: none; "title=" blob1.jpg "alt=" Wkiol1t9uigxucznaaduycljzoc452.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D7/wKiom1T9t2WxH3SfAAEzxZJXRO0139.jpg "style=" float: none; "title=" Files-concepts.png "alt=" Wkiom1t9t2wxh3sfaaezxzjxro0139.jpg "/>

The current creation and management of Azure file services is not accessible through the portal, the most convenient way is PowerShell (Azure module 0.8.5 or higher, if not met please update), the whole process is still very simple, First, you have a storage account such as: (The following may be the account name is inconsistent, because I switch between the global and the continental version, does not affect the demo)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D2/wKioL1T9up7za_jLAAMdVTsAQFg216.jpg "style=" float: none; "title=" 2015-03-05_17-03-54.png "alt=" Wkiol1t9up7za_jlaamdvtsaqfg216.jpg "/>

Typically when importing a publishsetting file for the first time, the default subscription is not associated with a storage account, so it is configured via PowerShell, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D7/wKiom1T9uYOy2CgyAAGL662pZJ8237.jpg "style=" float: none; "title=" 2015-03-05_17-04-09.png "alt=" Wkiom1t9uyoy2cgyaagl662pzj8237.jpg "/>

The next step is to create a share of the Azure file service, generally I used to set a storage account of the variable $key, and then generate a context variable $context, which is necessary, the context is mainly contained in the storage account and key (the main backup key can be), Next, you can create a file service share, which is the file share name immediately following the storage account, implemented by New-azurestorageshare, and needs to call the previous $context


But! There is a pit, not so much as a design flaw (at least I personally is so artificial), I hope to see this blog post of the cheese can be less around some bend, as described in the error, prompted me to resolve the name failure, Oddly, the name is not a domestic chinacloudapi.cn, but a global version of Windows.NET.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D2/wKioL1T9up_BKLS9AAcf2ilPsSE892.jpg "style=" float: none; "title=" 2015-03-05_17-54-35.png "alt=" Wkiol1t9up_bkls9aacf2ilpsse892.jpg "/>

So quickly check the grammar, sure enough to find a pit Dad's-environment parameters, remember before only in Get-azurepublishsettingfile will use it, did not think of file services also need, clearly before the Blob, table, Queue Service can directly point to the continental version, really do not understand ...

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D7/wKiom1T9uYOAvc9QAAcROHyRij4584.jpg "style=" float: none; "title=" 2015-03-05_17-55-29.png "alt=" Wkiom1t9uyoavc9qaacrohyrij4584.jpg "/>

Restart the configuration once $context, and add azurechinacloud, such as

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D2/wKioL1T9uqDTOsZ9AAK8ysw7sb0570.jpg "style=" float: none; "title=" 2015-03-05_17-57-24.png "alt=" Wkiol1t9uqdtosz9aak8ysw7sb0570.jpg "/>

Try again to create the file share name "Labshare01", sure enough ...

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D7/wKiom1T9uYSDfI5xAAMjWNuLzk4119.jpg "style=" float: none; "title=" 2015-03-05_17-58-50.png "alt=" Wkiom1t9uysdfi5xaamjwnulzk4119.jpg "/>

View existing file shares to see LABSHARE01

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D2/wKioL1T9uqCymw5ZAAHWGHI0moc955.jpg "style=" float: none; "title=" 2015-03-05_18-04-20.png "alt=" Wkiol1t9uqcymw5zaahwghi0moc955.jpg "/>

After you have the account and share, you can create a directory, and under LABSHARE01, create a folder called "Share01folder01", such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D7/wKiom1T9uYWzDqXGAAHtv55n1fc831.jpg "style=" float: none; "title=" 2015-03-05_18-06-05.png "alt=" Wkiom1t9uywzdqxgaahtv55n1fc831.jpg "/>

So far the Azure file service has been created, then the file service can be used to upload and manage the required data, I generated a TXT document locally, and then uploaded it to the Share01folder01 folder, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D2/wKioL1T9uqHi-26HAAKkDWECqZw830.jpg "style=" float: none; "title=" 2015-03-05_18-13-55.png "alt=" Wkiol1t9uqhi-26haakkdwecqzw830.jpg "/>

The Get-azurestoragefile view has been uploaded successfully, also with the Azcopy tool can be done, and azcopy support between the BLOB and FileShare data copy, or very useful

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D7/wKiom1T9uYbgI-tRAAONsecjMEY615.jpg "style=" float: none; "title=" 2015-03-05_18-14-37.png "alt=" Wkiom1t9uybgi-traaonsecjmey615.jpg "/>

####################################################################################

As mentioned above, how to create an Azure file service quickly and easily, and how to use it, first Azure file services can be used by azure virtual machines and cloud services, and any number of virtual machines or other roles (Web/worker) can mount file shares at the same time. The local application can also access the data in the share through the file API, unfortunately the local client cannot mount the share directly via the Azure storage account and key, only AZUREVM can use, for example, using NET to mount the previously created share to my virtual machine. After success, you can see the z-disk mapping labshare01

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D2/wKioL1T9uqKChtfwAAVAziWFkqc140.jpg "style=" float: none; "title=" 2015-03-05_18-37-50.png "alt=" Wkiol1t9uqkchtfwaavaziwfkqc140.jpg "/>

This allows me to easily access the data from the AZUREVM, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D7/wKiom1T9uYfg2AS8AAQ_ZdlK_Pg941.jpg "style=" float: none; "title=" 2015-03-05_18-39-13.png "alt=" Wkiom1t9uyfg2as8aaq_zdlk_pg941.jpg "/>

But in most scenarios, we need to automatically re-connect shares (as with network mappings) when a virtual machine restarts, and you can save your azure storage account and key credentials locally by cmdkey in

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D2/wKioL1T9uqOwjL7-AALczySP-6g770.jpg "style=" float: none; "title=" 2015-03-05_18-41-22.png "alt=" Wkiol1t9uqowjl7-aalczysp-6g770.jpg "/>

But the pit is here again ... After the above method, the link fails after restarting, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/D7/wKiom1T9uYiSGCnqAAOdGKiywkA115.jpg "style=" float: none; "title=" 2015-03-09_22-36-41.png "alt=" Wkiom1t9uyisgcnqaaodgkiywka115.jpg "/>

After sharing the memory manually entered the storage account key, it can be normal access, it began to be very strange why the Jiangzi, the local saved credentials and I entered the affirmation of the same, but can not automatically re-connect

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D2/wKioL1T9uqSDxhoyAAPuGmcR8J8612.jpg "style=" float: none; "title=" 2015-03-09_22-37-35.png "alt=" Wkiol1t9uqsdxhoyaapugmcr8j8612.jpg "/>

After consulting and self-verification, we need to use Cmdkey to save the credentials before mount sharing ... This is another pit.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/D7/wKiom1T9uYiBe4jPAARBDVj_9tQ553.jpg "style=" float: none; "title=" 2015-03-09_22-48-25.png "alt=" Wkiom1t9uyibe4jpaarbdvj_9tq553.jpg "/>

Then restart AZUREVM to verify if it works

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D2/wKioL1T9uqXR2o6pAANQHoXJFQw406.jpg "style=" float: none; "title=" 2015-03-09_22-49-37.png "alt=" Wkiol1t9uqxr2o6paanqhoxjfqw406.jpg "/>

This time the automatic connection, it seems that the operation of the steps there are sequencing requirements (technically it is not justified.) )

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D7/wKiom1T9uYmgDNiFAANVAaaWEQs533.jpg "style=" float: none; "title=" 2015-03-09_22-52-31.png "alt=" Wkiom1t9uymgdnifaanvaaaweqs533.jpg "/>

Azure file service is easy to implement and easy to use, it makes it possible for users to have a choice of public cloud storage services, and for existing on-premises applications, it is a simple implementation to consider using Azure file services when migrating to the cloud. If Azure supports SMB3.0 in the future, more highlights are expected.

This article is from the "Technology Not Home" blog, please be sure to keep this source http://maomaostyle.blog.51cto.com/2220531/1618847

Azure Storage's File services

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.