Window Azure 之Azure Storage檔案分享權限設定儲存

來源:互聯網
上載者:User

標籤:azure   storage   檔案分享權限設定   new-azurestorage   

今天就簡單講一下如何在Azure Storage帳號建立檔案分享權限設定,並掛載在Azure VM上。(順便吐槽一下,中國Azure官方文檔能不能翻譯好一下,直譯global azure 一回事,技術文檔的校正完全沒做好)

我們先在Azure上建立一個測試vm,具體可以參考:http://gshao.blog.51cto.com/3512873/1344846

1. 在Azure 上建立一個Storage帳號;

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/71/F0/wKiom1Xa_5OgRvfoAAHXUtwYrto540.jpg" height="504" />

2.登陸window azure powershell,配置下檔案分享權限設定;

輸入:

Get-AzurePublishSettingsFile -Environment AzureChinaCloud

mport-AzurePublishSettingsFile “****.publishsettings”(設定檔的路徑)

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/71/F0/wKiom1Xa_5SQror4AAGksW8JSUE425.jpg" height="95" />

配置儲存帳號上下文

$ctx=New-AzureStorageContext –StorageAccountName account-name –StorageAccountKey account-key -environment "AzureChinaCloud"(中國區才要加這個,global不用)

建立共用資料夾

$s=New-AzureStorageShare sharefiles(共用資料夾名) -Context $ctx

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/71/F0/wKiom1Xa_5aiHoDXAAEu86TcMJQ328.jpg" height="61" />

可以用命令查看file的情況:

輸入:Get-AzureStorageFile –Share $s

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/71/F0/wKiom1Xa_5fRdbFSAABKUHB4-II308.jpg" height="50" />

3.在Azure VM掛載檔案分享權限設定;

在powershell輸入:

cmdkey /add:<storage-account-name>.file.core.windows.net /user:<storage-account-name> /pass:<storage-account-key>

這個是為了儲存憑據,以便重啟vm不會導致檔案分享權限設定的登陸憑據丟失

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/71/F0/wKiom1Xa_5nicy-SAAFGhQf5LdY841.jpg" height="76" />

添加檔案分享權限設定儲存:

net use z: \\ <storage-account>.file.core.chinacloudapi.cn\共用資料夾名 /u:<storage-account> <storage-account-key>

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/71/F0/wKiom1Xa_5vztLwcAAEWBhntLzo722.jpg" height="72" />

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/71/F0/wKiom1Xa_53ADuQ0AAEVAlWxHG8181.jpg" height="257" />

嗯,猜一下這個檔案夾大概多少儲存空間呢。答案是5TB

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/71/F0/wKiom1Xa_5_hLSpnAADRW9wL4mA858.jpg" height="288" />

但是我蠻奇怪,中國azure的說法

(原話是

  • 共用:檔案儲存體共用是在 Azure 中的 SMB 2.1 檔案分享權限設定。必須在父共用中建立所有目錄和檔案。一個帳戶可以包含無限數量的共用,一個共用可以儲存無限數量的檔案,直至達到儲存體帳戶的容量限制。

具體可以看一下中國Azure關於檔案分享權限設定儲存連結:http://www.windowsazure.cn/documentation/articles/storage-dotnet-how-to-use-files

本文出自 “gs_hao” 部落格,謝絕轉載!

Window Azure 之Azure Storage檔案分享權限設定儲存

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.