使用存储资源管理器管理 Azure Blob 存储资源Manage Azure Blob Storage resources with Storage Explorer

概述Overview

Azure Blob 存储是用于存储大量非结构化数据(例如文本或二进制数据)的服务,这些数据可通过 HTTP 或 HTTPS 从世界各地进行访问。Azure Blob Storage is a service for storing large amounts of unstructured data, such as text or binary data, that can be accessed from anywhere in the world via HTTP or HTTPS. 可以使用 Blob 存储向外公开数据,或者私下存储应用程序数据。You can use Blob storage to expose data publicly to the world, or to store application data privately. 本文介绍如何使用存储资源管理器来处理 Blob 容器和 Blob。In this article, you'll learn how to use Storage Explorer to work with blob containers and blobs.

先决条件Prerequisites

若要完成本文中的步骤,需要满足以下先决条件:To complete the steps in this article, you'll need the following:

创建 Blob 容器Create a blob container

所有 Blob 都必须驻留在 Blob 容器中。简单说来,该容器就是对 Blob 进行逻辑分组。All blobs must reside in a blob container, which is simply a logical grouping of blobs. 一个帐户可以包含无限数量的容器,一个容器可以存储无限数量的 Blob。An account can contain an unlimited number of containers, and each container can store an unlimited number of blobs.

以下步骤演示了如何在存储资源管理器中创建 Blob 容器。The following steps illustrate how to create a blob container within Storage Explorer.

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中,展开需要在其中创建 Blob 容器的存储帐户。In the left pane, expand the storage account within which you wish to create the blob container.

  3. 右键单击“Blob 容器”,然后从上下文菜单中选择“创建 Blob 容器”。 Right-click Blob Containers, and - from the context menu - select Create Blob Container.

    “创建 Blob 容器”上下文菜单

  4. 此时会在“Blob 容器”文件夹下显示一个文本框。 A text box will appear below the Blob Containers folder. 输入 Blob 容器的名称。Enter the name for your blob container. 有关命名 blob 容器的规则和限制的信息,请参阅创建容器See Create a container for information on rules and restrictions on naming blob containers.

    “创建 Blob 容器”文本框

  5. 完成时按 Enter 可创建 Blob 容器,按 Esc 可取消相关操作。Press Enter when done to create the blob container, or Esc to cancel. 成功创建 Blob 容器后,该容器将显示在所选存储帐户的“Blob 容器”文件夹下。 Once the blob container has been successfully created, it will be displayed under the Blob Containers folder for the selected storage account.

    已创建的 Blob 容器

查看 Blob 容器的内容View a blob container's contents

Blob 容器包含 Blob 和文件夹(其中也可能包含 Blob)。Blob containers contain blobs and folders (that can also contain blobs).

以下步骤演示了如何在存储资源管理器中查看 Blob 容器的内容:The following steps illustrate how to view the contents of a blob container within Storage Explorer:

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中,展开包含你想要查看的 Blob 容器的存储帐户。In the left pane, expand the storage account containing the blob container you wish to view.

  3. 展开该存储帐户的“Blob 容器”。 Expand the storage account's Blob Containers.

  4. 右键单击想要查看的 Blob 容器,然后从上下文菜单中选择“打开 Blob 容器编辑器”。 Right-click the blob container you wish to view, and - from the context menu - select Open Blob Container Editor. 也可双击想要查看的 Blob 容器。You can also double-click the blob container you wish to view.

    “打开 Blob 容器编辑器”上下文菜单

  5. 主窗格会显示 Blob 容器的内容。The main pane will display the blob container's contents.

    Blob 容器编辑器

删除 Blob 容器Delete a blob container

可以根据需要轻松地创建和删除 Blob 容器。Blob containers can be easily created and deleted as needed. (若要了解如何删除各个 Blob,请参阅管理 Blob 容器中的 Blob 部分。)(To see how to delete individual blobs, refer to the section, Managing blobs in a blob container.)

以下步骤演示了如何在存储资源管理器中删除 Blob 容器。The following steps illustrate how to delete a blob container within Storage Explorer:

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中,展开包含你想要查看的 Blob 容器的存储帐户。In the left pane, expand the storage account containing the blob container you wish to view.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 右键单击想要删除的 Blob 容器,然后从上下文菜单中选择“删除”。Right-click the blob container you wish to delete, and - from the context menu - select Delete. 也可通过按“删除”来删除当前选定的 Blob 容器。You can also press Delete to delete the currently selected blob container.

    “删除 Blob 容器”上下文菜单

  5. 出现确认对话框时,选择“是”。Select Yes to the confirmation dialog.

    “删除 Blob 容器”确认

复制 Blob 容器Copy a blob container

可以通过存储资源管理器将 Blob 容器复制到剪贴板,然后再将该 Blob 容器粘贴到另一存储帐户中。Storage Explorer enables you to copy a blob container to the clipboard, and then paste that blob container into another storage account. (若要了解如何复制各个 Blob,请参阅管理 Blob 容器中的 Blob 部分。)(To see how to copy individual blobs, refer to the section, Managing blobs in a blob container.)

以下步骤演示了如何将 Blob 容器从一个存储帐户复制到另一个存储帐户。The following steps illustrate how to copy a blob container from one storage account to another.

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中,展开包含你想要复制的 Blob 容器的存储帐户。In the left pane, expand the storage account containing the blob container you wish to copy.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 右键单击想要复制的 Blob 容器,然后从上下文菜单中选择“复制 Blob 容器”。Right-click the blob container you wish to copy, and - from the context menu - select Copy Blob Container.

    “复制 Blob 容器”上下文菜单

  5. 右键单击要将 Blob 容器粘贴到其中的“目标”存储帐户,然后从上下文菜单中选择“粘贴 Blob 容器”。Right-click the desired "target" storage account into which you want to paste the blob container, and - from the context menu - select Paste Blob Container.

    “粘贴 Blob 容器”上下文菜单

获取 Blob 容器的 SASGet the SAS for a blob container

共享访问签名 (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.

以下步骤演示了如何为 Blob 容器创建 SAS:The following steps illustrate how to create a SAS for a blob container:

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中展开存储帐户,其中包含你想要获取其 SAS 的 Blob 容器。In the left pane, expand the storage account containing the blob container for which you wish to get a SAS.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 右键单击所需 Blob 容器,然后从上下文菜单中选择“获取共享访问签名”。Right-click the desired blob container, and - from the context menu - select Get Shared Access Signature.

    “获取 SAS”上下文菜单

  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. 然后会显示第二个“共享访问签名”对话框,其中列出了可用来访问存储资源的 Blob 容器以及 URL 和 QueryString。A second Shared Access Signature dialog will then display that lists the blob container 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 URL

  8. 完成后,选择“关闭”。When done, select Close.

管理 Blob 容器的访问策略Manage Access Policies for a blob container

以下步骤演示了如何管理(添加和删除)Blob 容器的访问策略:The following steps illustrate how to manage (add and remove) access policies for a blob container:

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中展开存储帐户,其中包含你想要管理其访问策略的 Blob 容器。In the left pane, expand the storage account containing the blob container whose access policies you wish to manage.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 选择所需 Blob 容器,然后从上下文菜单中选择“管理访问策略”。Select the desired blob container, and - from the context menu - select Manage Access Policies.

    “管理访问策略”上下文菜单

  5. “访问策略”对话框将列出为所选 Blob 容器创建的任何访问策略。The Access Policies dialog will list any access policies already created for the selected blob container.

    “访问策略”选项

  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.

为 Blob 容器设置公共访问级别Set the Public Access Level for a blob container

默认情况下,每个 Blob 容器都设置为“无公共访问权限”。By default, every blob container is set to "No public access".

以下步骤演示了如何指定 Blob 容器的公共访问级别。The following steps illustrate how to specify a public access level for a blob container.

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中展开存储帐户,其中包含你想要管理其访问策略的 Blob 容器。In the left pane, expand the storage account containing the blob container whose access policies you wish to manage.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 选择所需 Blob 容器,然后从上下文菜单中选择“设置公共访问级别”。Select the desired blob container, and - from the context menu - select Set Public Access Level.

    “设置公共访问级别”上下文菜单

  5. 在“设置容器公共访问级别”对话框中,指定所需的访问级别。In the Set Container Public Access Level dialog, specify the desired access level.

    “设置公共访问级别”选项

  6. 选择“应用”。Select Apply.

管理 Blob 容器中的 BlobManaging blobs in a blob container

创建 Blob 容器以后,即可将 Blob 上传到该 Blob 容器、将 Blob 下载到本地计算机、在本地计算机上打开 Blob,等等。Once you've created a blob container, you can upload a blob to that blob container, download a blob to your local computer, open a blob on your local computer, and much more.

以下步骤演示如何管理 Blob 容器中的 Blob(和文件夹)。The following steps illustrate how to manage the blobs (and folders) within a blob container.

  1. 打开存储资源管理器。Open Storage Explorer.

  2. 在左窗格中,展开包含你想要管理的 Blob 容器的存储帐户。In the left pane, expand the storage account containing the blob container you wish to manage.

  3. 展开该存储帐户的“Blob 容器”。Expand the storage account's Blob Containers.

  4. 双击想要查看的 Blob 容器。Double-click the blob container you wish to view.

  5. 主窗格会显示 Blob 容器的内容。The main pane will display the blob container's contents.

    查看 Blob 容器

  6. 主窗格会显示该 Blob 容器的内容。The main pane will display the blob container's contents.

  7. 根据所要执行的任务完成以下步骤:Follow these steps depending on the task you wish to perform:

    • 将文件上传到 Blob 容器Upload files to a blob container

      1. 在主窗格的工具栏上选择“上载”,并从下拉菜单中选择“上载文件”。On the main pane's toolbar, select Upload, and then Upload Files from the drop-down menu.

        “上传文件”菜单

      2. 在“上传文件”对话框中,选择“文件”文本框右侧的省略号 () 按钮,以选择要上传的文件。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.

        “上传文件”选项

      3. 将类型指定为“Blob 类型”。Specify the type of Blob type. 有关详细信息,请参阅创建容器和设置权限See Create the container and set permissions for more information.

      4. (可选)指定要将选定文件上传到其中的目标文件夹。Optionally, specify a target folder into which the selected file(s) will be uploaded. 如果目标文件夹不存在,系统会创建一个。If the target folder doesn't exist, it will be created.

      5. 选择“上传”。Select Upload.

    • 将文件夹上传到 Blob 容器Upload a folder to a blob container

      1. 在主窗格的工具栏上选择“上载”,并从下拉菜单中选择“上载文件夹”。On the main pane's toolbar, select Upload, and then Upload Folder from the drop-down menu.

        “上传文件夹”菜单

      2. 在“上传文件夹”对话框中,选择“文件夹”文本框右侧的省略号 () 按钮,以选择要上传其内容的文件夹。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.

        “上传文件夹”选项

      3. 将类型指定为“Blob 类型”。Specify the type of Blob type. 有关详细信息,请参阅创建容器和设置权限See Create the container and set permissions for more information.

      4. (可选)指定要将选定文件夹的内容上传到其中的目标文件夹。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.

      5. 选择“上传”。Select Upload.

    • 将 Blob 下载到本地计算机Download a blob to your local computer

      1. 选择要下载的 Blob。Select the blob you wish to download.
      2. 在主窗格的工具栏上,选择“下载”。On the main pane's toolbar, select Download.
      3. 在“指定已下载 Blob 的保存位置”对话框中,指定要将 Blob 下载到其中的位置,以及要为 Blob 提供的名称。In the Specify where to save the downloaded blob dialog, specify the location where you want the blob downloaded, and the name you wish to give it.
      4. 选择“保存”。Select Save.
    • 在本地计算机上打开 BlobOpen a blob on your local computer

      1. 选择要打开的 Blob。Select the blob you wish to open.
      2. 在主窗格的工具栏上,选择“打开”。On the main pane's toolbar, select Open.
      3. 使用与 Blob 的基础文件类型相关联的应用程序下载和打开 Blob。The blob will be downloaded and opened using the application associated with the blob's underlying file type.
    • 将 Blob 复制到剪贴板Copy a blob to the clipboard

      1. 选择要复制的 Blob。Select the blob you wish to copy.
      2. 在主窗格的工具栏上,选择“复制”。On the main pane's toolbar, select Copy.
      3. 在左窗格中导航到另一 Blob 容器,并通过双击在主窗格中查看它。In the left pane, navigate to another blob container, and double-click it to view it in the main pane.
      4. 在主窗格的工具栏上选择“粘贴”,以创建 Blob 的副本。On the main pane's toolbar, select Paste to create a copy of the blob.
    • 删除 BlobDelete a blob

      1. 选择要删除的 Blob。Select the blob you wish to delete.
      2. 在主窗格的工具栏上,选择“删除”。On the main pane's toolbar, select Delete.
      3. 出现确认对话框时,选择“是”。Select Yes to the confirmation dialog.

后续步骤Next steps