创建存储帐户Create a storage account

Azure 存储帐户包含所有 Azure 存储数据对象:Blob、文件、队列、表和磁盘。An Azure storage account contains all of your Azure Storage data objects: blobs, files, queues, tables, and disks. 存储帐户为你的 Azure 存储数据提供了一个唯一的命名空间,可以从世界上的任何位置通过 HTTP 或 HTTPS 访问该命名空间。The storage account provides a unique namespace for your Azure Storage data that is accessible from anywhere in the world over HTTP or HTTPS. Azure 存储帐户中的数据是持久的,高度可用、安全且可大规模缩放。Data in your Azure storage account is durable and highly available, secure, and massively scalable.

本操作指南文章介绍如何使用 Azure 门户Azure PowerShellAzure CLIAzure 资源管理器模板创建存储帐户。In this how-to article, you learn to create a storage account using the Azure portal, Azure PowerShell, Azure CLI, or an Azure Resource Manager template.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

必备条件Prerequisites

如果没有 Azure 订阅,可在开始前创建一个 1 元人民币试用帐户If you don't have an Azure subscription, create a 1rmb trial account before you begin.

无。None.

登录 AzureSign in to Azure

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

创建存储帐户Create a storage account

每个存储帐户都必须属于 Azure 资源组。Every storage account must belong to an Azure resource group. 资源组是对 Azure 资源进行分组的逻辑容器。A resource group is a logical container for grouping your Azure services. 在创建存储帐户时,可以选择创建新的资源组,也可以使用现有资源组。When you create a storage account, you have the option to either create a new resource group, or use an existing resource group. 本文介绍如何创建新资源组。This article shows how to create a new resource group.

可以使用常规用途 v2 存储帐户访问所有 Azure 存储服务:Blob、文件、队列、表和磁盘。A general-purpose v2 storage account provides access to all of the Azure Storage services: blobs, files, queues, tables, and disks. 本文所述的步骤将创建常规用途 v2 存储帐户,但创建任何类型的存储帐户的步骤都相似。The steps outlined here create a general-purpose v2 storage account, but the steps to create any type of storage account are similar. 有关存储帐户类型和其他存储帐户设置的详细信息,请参阅 Azure 存储帐户概述For more information about types of storage accounts and other storage account settings, see Azure storage account overview.

若要在 Azure 门户中创建常规用途 v2 存储帐户,请执行以下步骤:To create a general-purpose v2 storage account in the Azure portal, follow these steps:

  1. 在 Azure 门户菜单中,选择“所有服务” 。On the Azure portal menu, select All services. 在资源列表中,键入“存储帐户” 。In the list of resources, type Storage Accounts. 开始键入时,会根据输入筛选该列表。As you begin typing, the list filters based on your input. 选择“存储帐户” 。Select Storage Accounts.
  2. 在显示的“存储帐户”窗口中,选择“添加”。 On the Storage Accounts window that appears, choose Add.
  3. 在“基本信息”选项卡中,选择要在其中创建存储帐户的订阅。On the Basics tab, select the subscription in which to create the storage account.
  4. 在“资源组”字段中,选择所需的资源组或创建新的资源组。Under the Resource group field, select your desired resource group, or create a new resource group. 有关 Azure 资源组的详细信息,请参阅 Azure 资源管理器概述For more information on Azure resource groups, see Azure Resource Manager overview.
  5. 然后,输入存储帐户的名称。Next, enter a name for your storage account. 所选名称在 Azure 中必须唯一。The name you choose must be unique across Azure. 该名称的长度还必须介于 3 到 24 个字符之间,且只能包含数字和小写字母。The name also must be between 3 and 24 characters in length, and may include only numbers and lowercase letters.
  6. 选择存储帐户的位置或使用默认位置。Select a location for your storage account, or use the default location.
  7. 选择性能层。Select a performance tier. 默认层为“标准”。The default tier is Standard.
  8. 将“帐户类型”字段设置为“存储 V2 (常规用途 v2)”。Set the Account kind field to Storage V2 (general-purpose v2).
  9. 指定将如何复制存储帐户。Specify how the storage account will be replicated. 默认的复制选项为“读取访问权限异地冗余存储(RA-GRS)”。The default replication option is Read-access geo-redundant storage (RA-GRS). 要详细了解可用的复制选项,请参阅 Azure 存储冗余For more information about available replication options, see Azure Storage redundancy.
  10. 指定存储帐户中 Blob 的访问层。Specify the access tier for blobs in the storage account. 默认层为“热”。The default tier is hot. 有关 Blob 访问层的详细信息,请参阅 Blob 的热访问层、冷访问层和存档访问层For more information about blob access tiers, see Hot, cool, and archive access tiers for blobs.
  11. 若要使用 Azure Data Lake Storage,请选择“高级”选项卡,然后将“分层命名空间”设置为“启用” 。To use Azure Data Lake Storage, choose the Advanced tab, and then set Hierarchical namespace to Enabled. 有关详细信息,请参阅 Azure Data Lake Storage Gen2 简介For more information, see Azure Data Lake Storage Gen2 Introduction
  12. 选择“查看+创建”可查看存储帐户设置并创建帐户。Select Review + Create to review your storage account settings and create the account.
  13. 选择“创建” 。Select Create.

下图显示了新存储帐户的“基本信息”选项卡上的设置:The following image shows the settings on the Basics tab for a new storage account:

显示如何在 Azure 门户中创建存储帐户的屏幕截图

删除存储帐户Delete a storage account

删除存储帐户将删除整个帐户,包括该帐户中的所有数据,并且该操作无法撤销。Deleting a storage account deletes the entire account, including all data in the account, and cannot be undone.

  1. Azure 门户中导航到存储帐户。Navigate to the storage account in the Azure portal.
  2. 单击 “删除”Click Delete.

或者,你可以删除资源组,该操作将删除该资源组中的存储帐户和其他任何资源。Alternately, you can delete the resource group, which deletes the storage account and any other resources in that resource group. 有关删除资源组的详细信息,请参阅删除资源组和资源For more information about deleting a resource group, see Delete resource group and resources.

警告

无法恢复已删除的存储帐户,也无法检索删除之前该存储帐户包含的任何内容。It's not possible to restore a deleted storage account or retrieve any of the content that it contained before deletion. 请在删除帐户之前务必备份要保存的任何内容。Be sure to back up anything you want to save before you delete the account. 对于帐户中的任务资源也是如此 — 一旦你删除了一个 Blob、表、队列或文件,则它会被永久删除。This also holds true for any resources in the account—once you delete a blob, table, queue, or file, it is permanently deleted.

如果尝试删除与 Azure 虚拟机关联的存储帐户,则会显示一条错误消息,指出存储帐户仍在使用。If you try to delete a storage account associated with an Azure virtual machine, you may get an error about the storage account still being in use. 有关排除此错误的帮助信息,请参阅删除存储帐户时排除错误For help troubleshooting this error, see Troubleshoot errors when you delete storage accounts.

后续步骤Next steps