搭配使用儲存體總管與 Azure 檔案儲存體Using Storage Explorer with Azure File storage

Azure 檔案儲存體是使用標準伺服器訊息區塊 (SMB) 通訊協定,在雲端中提供檔案共用功能的服務。Azure File storage is a service that offers file shares in the cloud using the standard Server Message Block (SMB) Protocol. SMB 2.1 和 SMB 3.0 皆受到支援。Both SMB 2.1 and SMB 3.0 are supported. 使用 Azure 檔案儲存體時,您可以快速地將依賴檔案共用功能的舊式應用程式移轉至 Azure,而不必浪費成本來重新撰寫程式。With Azure File storage, you can migrate legacy applications that rely on file shares to Azure quickly and without costly rewrites. 您可以使用檔案儲存體向全球公開資料,或私下儲存應用程式資料。You can use File storage to expose data publicly to the world, or to store application data privately. 在本文中,您將學習如何使用儲存體總管來使用檔案共用和檔案。In this article, you'll learn how to use Storage Explorer to work with file shares and files.

必要條件Prerequisites

若要完成這篇文章中的步驟,您需要下列項目︰To complete the steps in this article, you'll need the following:

建立檔案共用Create a File Share

所有檔案必須都位於檔案共用,這是檔案的邏輯群組。All files must reside in a file share, which is simply a logical grouping of files. 帳戶可以包含無限數量的檔案共用,每個共用可以儲存無限數量的檔案。An account can contain an unlimited number of file shares, and each share can store an unlimited number of files.

下列步驟說明如何在儲存體總管中建立檔案共用。The following steps illustrate how to create a file share within Storage Explorer.

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開您要在其中建立檔案共用的儲存體帳戶In the left pane, expand the storage account within which you wish to create the File Share

  3. 以滑鼠右鍵按一下 [檔案共用] ,然後從內容功能表中 - 選取 [建立檔案共用] 。Right-click File Shares, and - from the context menu - select Create File Share.

    建立檔案共用

  4. [檔案共用] 資料夾底下會出現文字方塊。A text box will appear below the File Shares folder. 輸入檔案共用的名稱。Enter the name for your file share. 請參閱 共用命名規則 區段,以取得命名檔案共用的規則和限制的清單。See the Share naming rules section for a list of rules and restrictions on naming file shares.

    命名共用

  5. 完成建立檔案共用時按下 Enter鍵,或按下 Esc 鍵取消。Press Enter when done to create the file share, or Esc to cancel. 一旦成功建立檔案共用,它就會顯示在所選的儲存體帳戶的 [檔案共用] 資料夾底下。Once the file share has been successfully created, it will be displayed under the File Shares folder for the selected storage account.

    新增共用

檢視檔案共用的內容View a file share's contents

檔案共用包含檔案和資料夾 (也包含檔案)。File shares contain files and folders (that can also contain files).

下列步驟說明如何在儲存體總管中檢視檔案共用的內容:+The following steps illustrate how to view the contents of a file share within Storage Explorer:+

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要檢視的檔案共用。In the left pane, expand the storage account containing the file share you wish to view.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 以滑鼠右鍵按一下您想要檢視的檔案共用,從內容功能表中,選取 [開啟] 。Right-click the file share you wish to view, and - from the context menu - select Open. 您也可以按兩下想要檢視的檔案共用。You can also double-click the file share you wish to view.

    開啟共用

  5. 主窗格會顯示檔案共用的內容。The main pane will display the file share's contents.

    檔案共用的內容

刪除檔案共用Delete a file share

檔案共用可以輕鬆地建立並視需要刪除。File shares can be easily created and deleted as needed. (若要查看如何刪除個別的檔案,請參閱管理檔案共用中的檔案。)(To see how to delete individual files, refer to the section, Managing files in a file share.)

下列步驟說明如何在儲存體總管中刪除檔案共用:The following steps illustrate how to delete a file share within Storage Explorer:

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要檢視的檔案共用。In the left pane, expand the storage account containing the file share you wish to view.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 以滑鼠右鍵按一下您想要刪除的檔案共用,從內容功能表中,選取 [刪除] 。Right-click the file share you wish to delete, and - from the context menu - select Delete. 您也可以按 [刪除] 以刪除目前選取的檔案共用。You can also press Delete to delete the currently selected file share.

    Delete

  5. 選取確認對話方塊上的 [是] 。Select Yes to the confirmation dialog.

    確認對話方塊

複製檔案共用Copy a file share

儲存體總管可讓您將檔案共用複製到剪貼簿,然後將該檔案共用貼到另一個儲存體帳戶。Storage Explorer enables you to copy a file share to the clipboard, and then paste that file share into another storage account. (若要查看如何複製個別的檔案,請參閱管理檔案共用中的檔案。)(To see how to copy individual files, refer to the section, Managing files in a file share.)

下列步驟說明如何將檔案共用從某個儲存體帳戶複製到另一個儲存體帳戶。The following steps illustrate how to copy a file share from one storage account to another.

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要複製的檔案共用。In the left pane, expand the storage account containing the file share you wish to copy.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 以滑鼠右鍵按一下您想要複製的檔案共用,從內容功能表中,選取 [複製檔案共用] 。Right-click the file share you wish to copy, and - from the context menu - select Copy File Share.

    複製檔案共用

  5. 以滑鼠右鍵按一下想要貼上至檔案共用的「目標」儲存體帳戶,從內容功能表中,選取 [貼上檔案共用] 。Right-click the desired "target" storage account into which you want to paste the file share, and - from the context menu - select Paste File Share.

    貼上檔案共用

取得檔案共用的 SASGet the SAS for a file share

共用存取簽章 (SAS) 可提供您儲存體帳戶中資源的委派存取。A shared access signature (SAS) provides delegated access to resources in your storage account. 這表示您可以在無需分享您帳戶存取金鑰的情況下,將您儲存體帳戶中的物件有限權限授與用戶端,該用戶端便可在指定的時間期間內及使用指定的權限集來進行存取。This means that you can grant a client limited permissions to objects in your storage account for a specified period of time and with a specified set of permissions, without having to share your account access keys.

下列步驟說明如何建立檔案共用的 SAS:The following steps illustrate how to create a SAS for a file share:+

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要取得 SAS 的檔案共用。In the left pane, expand the storage account containing the file share for which you wish to get a SAS.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 以滑鼠右鍵按一下想要的檔案共用,從內容功能表中,選取 [取得共用存取簽章] 。Right-click the desired file share, and - from the context menu - select Get Shared Access Signature.

    取得共用存取簽章

  5. 在 [共用存取簽章] 對話方塊中,指定您要用於資源的原則、開始和到期日期、時區和存取層級。In the Shared Access Signature dialog, specify the policy, start and expiration dates, time zone, and access levels you want for the resource.

    SAS 對話方塊

  6. 當您完成指定 SAS 選項時,選取 [建立] 。When you're finished specifying the SAS options, select Create.

  7. 第二個 [共用存取簽章] 對話方塊會顯示,列出您可以用來存取儲存體資源的檔案共用及 URL 和 QueryStrings。A second Shared Access Signature dialog will then display that lists the file share along with the URL and QueryStrings you can use to access the storage resource. 選取您想要複製到剪貼簿的 URL 旁邊的 [複製] 。Select Copy next to the URL you wish to copy to the clipboard.

    第二個 SAS 對話方塊

  8. 完成時,選取 [關閉] 。When done, select Close.

管理檔案共用的存取原則Manage Access Policies for a file share

下列步驟說明如何管理 (新增和移除) 檔案共用的存取原則︰+。The following steps illustrate how to manage (add and remove) access policies for a file share:+ . 存取原則用來建立 SAS URL,使用者可藉此使用在定義的時間期間存取儲存體檔案資源。The Access Policies is used for creating SAS URLs through which people can use to access the Storage File resource during a defined period of time.

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要管理其存取原則的檔案共用。In the left pane, expand the storage account containing the file share whose access policies you wish to manage.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 選取想要的檔案共用,從內容功能表中,選取 [管理存取原則] 。Select the desired file share, and - from the context menu - select Manage Access Policies.

    管理存取原則內容功能表

  5. [存取原則] 對話方塊會列出已針對所選的檔案共用建立的任何存取原則。The Access Policies dialog will list any access policies already created for the selected file share.

    存取原則

  6. 根據存取原則管理工作遵循下列步驟︰Follow these steps depending on the access policy management task:

    • 新增新的存取原則 -選取 [新增] 。Add a new access policy - Select Add. 一旦產生,[存取原則] 對話方塊將會顯示新加入的存取原則 (具有預設設定)。Once generated, the Access Policies dialog will display the newly added access policy (with default settings).

    • 編輯存取原則 - 進行任何所需的編輯,然後選取 [儲存] 。Edit an access policy - Make any desired edits, and select Save.

    • 移除存取原則 -選取您想要移除的存取原則旁邊的 [移除] 。Remove an access policy - Select Remove next to the access policy you wish to remove.

  7. 使用您稍早建立的存取原則建立新的 SAS URL︰Create a new SAS URL using the Access Policy you created earlier:

    取得 SAS

    SAS 名稱和屬性

檔案共用中的管理檔案Managing files in a file share

建立檔案共用之後,您可以將檔案上傳至檔案共用、將檔案下載到本機電腦或在本機電腦上開啟檔案等等。Once you've created a file share, you can upload a file to that file share, download a file to your local computer, open a file on your local computer, and much more.

下列步驟說明如何管理檔案共用中的檔案 (及資料夾)。The following steps illustrate how to manage the files (and folders) within a file share.

  1. 開啟儲存體總管。Open Storage Explorer.

  2. 在左窗格中,展開儲存體帳戶,其中包含您要管理的檔案共用。In the left pane, expand the storage account containing the file share you wish to manage.

  3. 展開儲存體帳戶的 [檔案共用] 。Expand the storage account's File Shares.

  4. 按兩下想要檢視的檔案共用。Double-click the file share you wish to view.

  5. 主窗格會顯示檔案共用的內容。The main pane will display the file share's contents.

    檔案共用的內容

  6. 主窗格會顯示檔案共用的內容。The main pane will display the file share's contents.

  7. 根據您想要執行的工作遵循下列步驟︰Follow these steps depending on the task you wish to perform:

    • 將檔案上傳至檔案共用Upload files to a file share

      a.a. 在主窗格工具列上,選取 [上傳] ,然後從下拉式功能表選取 [上傳檔案] 。On the main pane's toolbar, select Upload, and then Upload Files from the drop-down menu.

      上傳檔案

      b.b. 在 [上傳檔案] 對話方塊中,選擇 [檔案] 文字方塊右側的省略符號 ( ) 按鈕,以選取您想要上傳的檔案。In the Upload files dialog, select the ellipsis () button on the right side of the Files text box to select the file(s) you wish to upload.

      新增檔案

      c.c. 選取 [上傳] 。Select Upload.

    • 將資料夾上傳至檔案共用Upload a folder to a file share

      a.a. 在主窗格工具列上,選取 [上傳] ,然後從下拉式功能表選取 [上傳資料夾] 。On the main pane's toolbar, select Upload, and then Upload Folder from the drop-down menu.

      上傳資料夾功能表

      b.b. 在 [上傳資料夾] 對話方塊中,選擇 [資料夾] 文字方塊右側的省略符號 ( ) 按鈕,以選取您想要上傳其內容的資料夾。In the Upload folder dialog, select the ellipsis () button on the right side of the Folder text box to select the folder whose contents you wish to upload.

      c.c. 選擇性地指定選取的資料夾的內容將會上傳至其中的目標資料夾。Optionally, specify a target folder into which the selected folder's contents will be uploaded. 如果目標資料夾不存在,系統就會加以建立。If the target folder doesn’t exist, it will be created.

      d.d. 選取 [上傳] 。Select Upload.

    • 將檔案下載到本機電腦Download a file to your local computer

      a.a. 選取您想要下載的檔案。Select the file you wish to download.

      b.b. 在主窗格工具列上選取 [下載] 。On the main pane's toolbar, select Download.

      c.c. 在 [指定儲存下載的檔案的位置] 對話方塊中,指定要下載檔案的位置,和您想要給予它的名稱。In the Specify where to save the downloaded file dialog, specify the location where you want the file downloaded, and the name you wish to give it.

      d.d. 選取 [ 儲存]。Select Save.

    • 在您的本機電腦上開啟檔案Open a file on your local computer

      a.a. 選取您想要開啟的檔案。Select the file you wish to open.

      b.b. 在主窗格工具列上選取 [開啟] 。On the main pane's toolbar, select Open.

      c.c. 檔案會被下載,並使用與檔案的基礎檔案類型相關聯的應用程式開啟。The file will be downloaded and opened using the application associated with the file's underlying file type.

    • 將檔案複製到剪貼簿Copy a file to the clipboard

      a.a. 選取您想要複製的檔案。Select the file you wish to copy.

      b.b. 在主窗格工具列上選取 [複製] 。On the main pane's toolbar, select Copy.

      c.c. 在左窗格中,瀏覽至另一個檔案共用,然後在主窗格中按兩下加以檢視。In the left pane, navigate to another file share, and double-click it to view it in the main pane.

      d.d. 在主窗格工具列上選取 [貼上] 以建立檔案的複本。On the main pane's toolbar, select Paste to create a copy of the file.

    • 刪除檔案Delete a file

      a.a. 選取您想要刪除的檔案。Select the file you wish to delete.

      b.b. 在主窗格工具列上選取 [刪除] 。On the main pane's toolbar, select Delete.

      c.c. 選取確認對話方塊上的 [是] 。Select Yes to the confirmation dialog.

後續步驟Next steps