存储资源管理器入门Get started with Storage Explorer

概述Overview

Azure 存储资源管理器是一款独立应用,可用于在 Windows、macOS 和 Linux 上轻松处理 Azure 存储数据。Azure Storage Explorer is a standalone app that enables you to easily work with Azure Storage data on Windows, macOS, and Linux. 本文介绍如何通过多种方式连接到 Azure 存储帐户并对其进行管理。In this article, you learn several ways of connecting to and managing your Azure storage accounts.

Azure 存储资源管理器

先决条件Prerequisites

以下版本的 Windows 支持 Azure 存储资源管理器:Azure Storage Explorer is supported on the following versions of Windows:

  • Windows 10(推荐)Windows 10 (recommended)
  • Windows 8Windows 8
  • Windows 7Windows 7

对于所有 Windows 版本,都需要 .NET Framework 4.6.2 或更高版本。For all versions of Windows, .NET Framework 4.6.2 or greater is required.

下载并安装存储资源管理器Download and install Storage Explorer

连接到存储帐户或服务Connect to a storage account or service

存储资源管理器提供多种连接到存储帐户的方式。Storage Explorer provides several ways to connect to storage accounts. 例如,可以:For example, you can:

  • 连接到与 Azure 订阅关联的存储帐户。Connect to storage accounts associated with your Azure subscriptions.
  • 连接到从其他 Azure 订阅共享的存储帐户和服务。Connect to storage accounts and services that are shared from other Azure subscriptions.
  • 使用 Azure 存储模拟器连接到本地存储并对其进行管理。Connect to and manage local storage by using the Azure Storage Emulator.

此外,还可以在全球以及各区域 Azure 中使用存储帐户:In addition, you can work with storage accounts in global and national Azure:

连接到 Azure 订阅Connect to an Azure subscription

Note

如果没有 Azure 帐户,可以注册试用版If you don't have an Azure account, you can sign up for a trial .

  1. 在存储资源管理器中选择“管理帐户”,转到“帐户管理面板”。In Storage Explorer, select Manage Accounts to go to the Account Management Panel.

    管理帐户

  2. 左窗格随即显示已登录的所有 Azure 帐户。The left pane now displays all the Azure accounts you've signed in to. 若要连接到另一个帐户,请选择“添加帐户”。To connect to another account, select Add an account

  3. 若要登录到某个国家/地区云或 Azure Stack,请单击“Azure 环境”下拉列表并选择要使用的 Azure 云。If you want to sign into a national cloud or an Azure Stack, click on the Azure environment dropdown to select which Azure cloud you want to use. 选择环境后,单击“登录...”按钮。Once you have chosen your environment, click the Sign in... button. 若要登录到 Azure Stack,请参阅将存储资源管理器连接到 Azure Stack 订阅了解详细信息。If you are signing in to Azure Stack, see Connect Storage Explorer to an Azure Stack subscription for more information.

    登录选项

  4. 使用 Azure 帐户成功登录后,该帐户以及与该帐户关联的 Azure Stack 订阅会添加到左窗格中。After you successfully sign in with an Azure account, the account and the Azure subscriptions associated with that account are added to the left pane. 选择使用的 Azure 订阅,然后选择“应用”(选择“所有订阅:”切换开关可选择列出的所有 Azure 订阅,或不选择其中的任何订阅)。Select the Azure subscriptions that you want to work with, and then select Apply (Selecting All subscriptions: toggles selecting all or none of the listed Azure subscriptions).

    选择 Azure 订阅

    左窗格会显示与所选 Azure 订阅关联的存储帐户。The left pane displays the storage accounts associated with the selected Azure subscriptions.

    选择的 Azure 订阅

使用本地开发存储Work with local development storage

使用存储资源管理器,可以通过模拟器使用本地存储。With Storage Explorer, you can work with local storage by using an emulator. 使用此方法可以模拟 Azure 存储的使用,而无需在 Azure 上部署存储帐户。This approach lets you simulate working with Azure Storage without necessarily having a storage account deployed on Azure.

从版本 1.1.0 开始,存储资源管理器支持在所有平台上使用本地存储模拟器。Starting with version 1.1.0, Storage Explorer supports using a local storage emulator on all platforms. 存储资源管理器可以连接到侦听其默认本地存储终结点的任何模拟服务。Storage Explorer can connect to any emulated service listening to its default local storage endpoints.

Note

对存储服务和功能的支持可能因你选择的模拟器而有很大不同。Support for storage services and features may vary widely depending on your choice of emulator. 请确保模拟器支持你打算使用的服务和功能。Make sure your emulator supports the services and features you intend to work with.

  1. 配置所选模拟器的服务,以侦听未使用的端口。Configure the services of your emulator of choice to listen to an unused port.

    模拟服务Emulated Service 默认终结点Default Endpoint
    BlobBlobs http://127.0.0.1:10000
    队列Queues http://127.0.0.1:10001
    Tables http://127.0.0.1:10002
  2. 启动模拟器。Start the emulator.

    Important

    存储资源管理器不会自动启动模拟器。Storage Explorer does not automatically start your emulator. 必须自行启动。You must start it yourself.

  3. 在存储资源管理器中,单击“添加帐户”按钮。In Storage Explorer, click the Add Account button. 选择“附加到本地模拟器”并单击“下一步”。Select Attach to a local emulator and click Next.

  4. 输入前面配置的服务的端口号(如果不想使用该服务则留空)。Enter the port numbers for the services you configured above (leave blank if you don't intend to use that service). 单击“下一步”,然后单击“连接”,以创建连接。Click Next then Connect to create the connection.

  5. 展开“本地和附加” > “存储帐户”>“节点”,然后展开模拟器连接对应的节点下的服务节点。Expand the Local & Attached > Storage Accounts > nodes, then expand the service nodes underneath the node corresponding to your emulator connection.

    可以使用此节点创建和使用本地 blob、队列和表。You can use this node to create and work with local blobs, queues, and tables. 若要了解如何使用每个存储帐户类型,请参阅以下指南:To learn how to work with each storage account type, refer to the following guides:

附加或分离外部存储帐户Attach or detach an external storage account

可以通过存储资源管理器附加到外部存储帐户,因此可以轻松共享存储帐户。With Storage Explorer, you can attach to external storage accounts so that storage accounts can be easily shared. 本部分介绍如何附加到外部存储帐户(以及如何从其分离)。This section explains how to attach to (and detach from) external storage accounts.

获取存储帐户凭据Get the storage account credentials

要共享外部存储帐户,首先必须由该帐户的所有者获取该帐户的凭据(帐户名称和密钥),然后将该信息共享给想要附加到指定帐户的人员。To share an external storage account, the owner of that account must first get the credentials (account name and key) for the account and then share that information with the person who wants to attach to said account. 可以执行以下步骤,通过 Azure 门户获取存储帐户凭据:You can obtain the storage account credentials via the Azure portal by doing the following steps:

  1. 登录到 Azure 门户Sign in to the Azure portal.

  2. 选择“浏览”。Select Browse.

  3. 选择“存储帐户”。Select Storage Accounts.

  4. 在“存储帐户”列表中,选择所需的存储帐户。In the list of Storage Accounts, select the desired storage account.

  5. 在“设置”下,选择“访问密钥”。Under Settings, select Access keys.

    “访问密钥”选项

  6. 复制“存储帐户名称”和“ 密钥 1”。Copy the Storage account name and key1.

    访问密钥

附加到外部存储帐户Attach to an external storage account

若要附加到某个外部存储帐户,需要该帐户的名称和密钥。To attach to an external storage account, you need the account's name and key. “获取存储帐户凭据”部分说明了如何从 Azure 门户获取这些值。The "Get the storage account credentials" section explains how to obtain these values from the Azure portal. 但在门户中,帐户密钥称为 key1However, in the portal, the account key is called key1. 因此,当存储资源管理器要求提供帐户密钥时,请输入“key1”值。So, when Storage Explorer asks for an account key, you enter the key1 value.

  1. 在存储资源管理器中,打开“连接对话”。In Storage Explorer, open the Connect Dialog.

    “连接到 Azure 存储”选项

  2. 在“连接对话”中,选择“使用存储帐户名称和密钥”。In the Connect Dialog, choose Use a storage account name and key

    使用名称和密钥的选项

  3. 在“帐户名称”文本框中粘贴帐户名称,在“帐户密钥”文本框中粘贴帐户密钥(从 Azure 门户获取的“密钥 1”值),然后选择“下一步”。Paste your account name in the Account name text box, and paste your account key (the key1 value from the Azure portal) into the Account key text box, and then select Next.

    名称和密钥页

    Note

    若要使用国家/地区云的名称和密钥,请使用“存储终结点域:”下拉列表选择相应的终结点域:To use a name and key from a national cloud, use the Storage endpoints domain: dropdown to select the appropriate endpoints domain:

  4. 在“连接摘要”对话框中验证信息。In the Connection Summary dialog box, verify the information. 如果想要更改任何设置,请选择“返回”并重新输入所需的设置。If you want to change anything, select Back and reenter the desired settings.

  5. 选择“连接” 。Select Connect.

  6. 成功附加存储帐户后,会显示该存储帐户,其名称后面追加了“(外部)”字样。After the storage account has successfully been attached, the storage account is displayed with (External) appended to its name.

    连接到外部存储帐户的结果

从外部存储帐户分离Detach from an external storage account

  1. 右键单击要分离的外部存储帐户,并选择“分离”。Right-click the external storage account that you want to detach, and then select Detach.

    “从存储分离”选项

  2. 在确认消息中,选择“是”确认从外部存储帐户中分离。In the confirmation message, select Yes to confirm the detachment from the external storage account.

使用共享访问签名 (SAS) 附加存储帐户 Attach a storage account by using a Shared Access Signature (SAS)

Azure 订阅的管理员可以通过共享访问签名 (SAS) 授予存储帐户的临时访问权限,不需提供 Azure 订阅凭据。A Shared Access Signature, or SAS, lets the admin of an Azure subscription grant temporary access to a storage account without having to provide Azure subscription credentials.

为了说明这一情形,假设 UserA 是 Azure 订阅的管理员,UserA 想要允许 UserB 在有限的时间内使用特定权限访问某个存储帐户:To illustrate this scenario, let's say that UserA is an admin of an Azure subscription, and UserA wants to allow UserB to access a storage account for a limited time with certain permissions:

  1. UserA 生成了一个适用于特定时间段且具有所需权限的 SAS 连接字符串。UserA generates a SAS connection string for a specific time period and with the desired permissions.

  2. UserA 将 SAS 与需要访问该存储帐户的人员(在本示例中为 UserB)共享。UserA shares the SAS with the person (UserB, in this example) who wants access to the storage account.

  3. UserB 通过存储资源管理器使用所提供的 SAS 附加到属于 UserA 的帐户。UserB uses Storage Explorer to attach to the account that belongs to UserA by using the supplied SAS.

为要共享的帐户生成 SAS 查询字符串Generate a SAS query string for the account you want to share

  1. 在存储资源管理器中,右键单击要共享的存储帐户,并选择“获取共享访问签名...”。In Storage Explorer, right-click the storage account you want share, and then select Get Shared Access Signature....

    “获取 SAS”上下文菜单选项

  2. 在“生成共享访问签名”对话框中,指定要授予该帐户的时间范围和权限,然后单击“创建”按钮。In the Generate Shared Access Signature dialog box, specify the time frame and permissions that you want for the account, and then click the Create button.

    “获取 SAS”对话框

  3. 选择“查询字符串”文本框旁边的“复制”,将其复制到剪贴板,然后单击“关闭”。Next to the Query String text box, select Copy to copy it to your clipboard, and then click Close.

使用 SAS 连接字符串附加到存储帐户Attach to a storage account by using a SAS Connection String

  1. 在存储资源管理器中,打开“连接对话”。In Storage Explorer, open the Connect Dialog.

    “连接到 Azure 存储”选项

  2. 在“连接对话”对话框中,选择“使用连接字符串或共享访问签名 URI”,然后单击“下一步”。In the Connect Dialog dialog, choose Use a connection string or shared access signature URI and then click Next.

    “连接到 Azure 存储”对话框

  3. 选择“使用连接字符串”,并在“连接字符串:”字段中粘贴连接字符串。Choose Use a connection string and paste your connection string into the Connection string: field. 单击“下一步”按钮。Click the Next button.

    “连接到 Azure 存储”对话框

  4. 在“连接摘要”对话框中验证信息。In the Connection Summary dialog box, verify the information. 要进行更改,请选择“上一步”,并输入所需的设置。To make changes, select Back, and then enter the settings you want.

  5. 选择“连接” 。Select Connect.

  6. 成功附加存储帐户后,会显示该存储帐户,其名称后面追加了“(SAS)”字样。After the storage account has successfully been attached, the storage account is displayed with (SAS) appended to its name.

    使用 SAS 附加到帐户的结果

使用共享访问签名 (SAS) 附加服务 Attach a service by using a Shared Access Signature (SAS)

“使用 SAS 附加存储帐户”部分介绍了 Azure 订阅管理员如何为存储帐户生成和共享 SAS,从而授予用户对存储帐户的临时访问权限。The "Attach a storage account by using a SAS" section explains how an Azure subscription admin can grant temporary access to a storage account by generating and sharing a SAS for the storage account. 同样可以在存储帐户中为特定服务(Blob 容器、队列、表或文件共享)生成 SAS。Similarly, a SAS can be generated for a specific service (blob container, queue, table, or file share) within a storage account.

为要共享的服务生成 SASGenerate an SAS for the service that you want to share

在这种情况下,服务可以是 Blob 容器、队列、表或文件共享。In this context, a service can be a blob container, queue, table, or file share. 若要为列出的服务生成 SAS,请参阅:To generate the SAS for a listed service, see:

使用 SAS URI 附加到共享帐户服务Attach to the shared account service by using a SAS URI

  1. 在存储资源管理器中,打开“连接对话”。In Storage Explorer, open the Connect Dialog.

    “连接到 Azure 存储”选项

  2. 在“连接对话”对话框中,选择“使用连接字符串或共享访问签名 URI”,然后单击“下一步”。In the Connect Dialog dialog box, choose Use a connection string or shared access signature URI and then click Next.

    “连接到 Azure 存储”对话框

  3. 选择“使用 SAS URI”并在“URI:”字段中粘贴 URI。Choose Use a SAS URI and paste your URI into the URI: field. 单击“下一步”按钮。Click the Next button.

    “连接到 Azure 存储”对话框

  4. 在“连接摘要”对话框中验证信息。In the Connection Summary dialog box, verify the information. 要进行更改,请选择“上一步”,并输入所需的设置。To make changes, select Back, and then enter the settings you want.

  5. 选择“连接” 。Select Connect.

  6. 成功附加服务后,该服务会显示在“(SAS 附加的服务)”节点下。After the service is successfully attached, the service is displayed under the (SAS-Attached Services) node.

    使用 SAS 附加到共享服务的结果

使用连接字符串连接到 Azure Cosmos DB 帐户Connect to an Azure Cosmos DB account by using a connection string

除了通过 Azure 订阅管理 Azure Cosmos DB 帐户外,连接到 Azure Cosmos DB 的另一种方法是使用连接字符串。Besides manage Azure Cosmos DB accounts through Azure subscription, an alternative way of connecting to an Azure Cosmos DB is to use a connection string. 按照以下步骤可使用连接字符串进行连接。Use the following steps to connect using a connection string.

  1. 在左侧树中找到“本地和附加”,右键单击“Azure Cosmos DB 帐户”,然后选择“连接到 Azure Cosmos DB...”Find Local and Attached in the left tree, right-click Azure Cosmos DB Accounts, choose Connect to Azure Cosmos DB...

    通过连接字符串连接到 Azure Cosmos DB

  2. 选择 Azure Cosmos DB API,粘贴“连接字符串”,然后单击“确定”连接 Azure Cosmos DB 帐户。Choose Azure Cosmos DB API, paste your Connection String, and then click OK to connect Azure Cosmos DB account. 有关检索连接字符串的信息,请参阅获取连接字符串For information on retrieving the connection string, see Get the connection string.

    连接字符串

搜索存储帐户Search for storage accounts

如果需要查找某个存储资源并且不知道它的所在位置,可以使用左窗格顶部的搜索框来搜索该资源。If you need to find a storage resource and do not know where it is, you can use the search box at the top of the left pane to search for the resource.

在搜索框中键入内容时,左窗格会显示与当前已输入搜索值匹配的所有资源。As you type in the search box, the left pane displays all resources that match the search value you've entered up to that point. 例如,以下屏幕截图显示了“终结点”的搜索结果:For example, a search for endpoints is shown in the following screenshot:

存储帐户搜索

Note

使用“帐户管理面板”取消选择不包含所要搜索的项的所有订阅,以改善搜索执行时间。Use the Account Management Panel to deselect any subscriptions that do not contain the item you are searching for to improve the execution time of your search. 还可以右键单击某个节点,然后选择“从此处搜索”,从特定的节点开始搜索。You can also right-click on a node and choose Search From Here to start searching from a specific node.

后续步骤Next steps