核心 Azure 存储服务简介Introduction to the core Azure Storage services

Azure 存储平台是 Microsoft 提供的适用于现代数据存储方案的云存储解决方案。The Azure Storage platform is Microsoft's cloud storage solution for modern data storage scenarios. 核心存储服务为数据对象提供可大规模缩放的对象存储、为 Azure 虚拟机 (VM) 提供磁盘存储、为云提供文件系统服务,并且提供用于可靠消息传送的消息传送存储以及 NoSQL 存储。Core storage services offer a massively scalable object store for data objects, disk storage for Azure virtual machines (VMs), a file system service for the cloud, a messaging store for reliable messaging, and a NoSQL store. 这些服务包括:The services are:

  • 持久且具有高可用性。Durable and highly available. 冗余可确保数据在发生短暂的硬件故障时是安全的。Redundancy ensures that your data is safe in the event of transient hardware failures. 还可以选择在各个数据中心或地理区域之间复制数据,从而在发生本地灾难或自然灾害时提供额外的保护。You can also opt to replicate data across datacenters or geographical regions for additional protection from local catastrophe or natural disaster. 以此方式复制的数据在发生意外中断时将保持高可用性。Data replicated in this way remains highly available in the event of an unexpected outage.
  • 安全。Secure. 该服务会对写入到 Azure 存储帐户的所有数据进行加密。All data written to an Azure storage account is encrypted by the service. Azure 存储可以精细地控制谁可以访问你的数据。Azure Storage provides you with fine-grained control over who has access to your data.
  • 可缩放。Scalable. Azure 存储设计为可大规模缩放以满足当今的应用程序在数据存储和性能方面的需求。Azure Storage is designed to be massively scalable to meet the data storage and performance needs of today's applications.
  • 托管的。Managed. Azure 为你处理硬件维护、更新和关键问题。Azure handles hardware maintenance, updates, and critical issues for you.
  • 易访问。Accessible. 可以通过 HTTP 或 HTTPS 从世界上的任何位置访问 Azure 存储中的数据。Data in Azure Storage is accessible from anywhere in the world over HTTP or HTTPS. Microsoft 以各种语言(包括 NET、Java、Node.js、Python、PHP、Ruby、Go 和其他语言)提供了适用于 Azure 存储的客户端库以及成熟的 REST API。Microsoft provides client libraries for Azure Storage in a variety of languages, including .NET, Java, Node.js, Python, PHP, Ruby, Go, and others, as well as a mature REST API. Azure 存储支持通过 Azure PowerShell 或 Azure CLI 运行脚本。Azure Storage supports scripting in Azure PowerShell or Azure CLI. 而且,Azure 门户和 Azure 存储资源管理器提供了用于处理数据的简单可视化解决方案。And the Azure portal and Azure Storage Explorer offer easy visual solutions for working with your data.

核心存储服务Core storage services

Azure 存储平台包括以下数据服务:The Azure Storage platform includes the following data services:

  • Azure Blob:适用于文本和二进制数据的可大规模缩放的对象存储。Azure Blobs: A massively scalable object store for text and binary data. 还包括通过 Data Lake Storage Gen2 支持大数据分析。Also includes support for big data analytics through Data Lake Storage Gen2.
  • Azure 文件:适用于云或本地部署的托管文件共享。Azure Files: Managed file shares for cloud or on-premises deployments.
  • Azure 队列:用于在应用程序组件之间进行可靠的消息传送的消息存储。Azure Queues: A messaging store for reliable messaging between application components.
  • Azure 表:一种 NoSQL 存储,适合用作结构化数据的无架构存储。Azure Tables: A NoSQL store for schemaless storage of structured data.
  • Azure 磁盘:Azure VM 的块级存储卷。Azure Disks: Block-level storage volumes for Azure VMs.

对每个服务的访问都通过存储帐户进行。Each service is accessed through a storage account. 若要开始使用,请参阅创建存储帐户To get started, see Create a storage account.

示例方案Example scenarios

下表比较了文件、Blob、磁盘、队列和表,并显示了每一项的示例方案。The following table compares Files, Blobs, Disks, Queues, and Tables, and shows example scenarios for each.

功能Feature 说明Description 何时使用When to use
Azure 文件Azure Files 提供完全托管的云文件共享,让你能从任何位置通过行业标准服务器消息块 (SMB) 协议进行访问。Offers fully managed cloud file shares that you can access from anywhere via the industry standard Server Message Block (SMB) protocol.

你可以在云或 Windows、Linux 和 macOS 的本地部署装载 Azure 文件共享。You can mount Azure file shares from cloud or on-premises deployments of Windows, Linux, and macOS.
希望将已使用本机文件系统 API 的应用程序直接迁移到云中,以在该应用程序与 Azure 中运行的其他应用程序之间共享数据。You want to "lift and shift" an application to the cloud that already uses the native file system APIs to share data between it and other applications running in Azure.

希望替换或补充本地文件服务器或 NAS 设备。You want to replace or supplement on-premises file servers or NAS devices.

希望存储需要从多个虚拟机访问的开发和调试工具时。You want to store development and debugging tools that need to be accessed from many virtual machines.
Azure BlobAzure Blobs 允许在块 blob 中大规模存储和访问非结构化数据。Allows unstructured data to be stored and accessed at a massive scale in block blobs.

还支持 Azure Data Lake Storage Gen2,用于企业大数据分析解决方案。Also supports Azure Data Lake Storage Gen2 for enterprise big data analytics solutions.
希望应用程序支持流式处理和随机访问方案时。You want your application to support streaming and random access scenarios.

希望可以从任何位置访问应用程序数据时。You want to be able to access application data from anywhere.

想要在 Azure 上生成企业数据湖并执行大数据分析。You want to build an enterprise data lake on Azure and perform big data analytics.
Azure 磁盘Azure Disks 允许数据永久存储在附加虚拟硬盘中并从中进行访问。Allows data to be persistently stored and accessed from an attached virtual hard disk. 希望直接迁移使用本机文件系统 API 将数据读写到永久磁盘中的应用程序。You want to "lift and shift" applications that use native file system APIs to read and write data to persistent disks.

希望存储不要求从附加磁盘的虚拟机外进行访问的数据时。You want to store data that is not required to be accessed from outside the virtual machine to which the disk is attached.
Azure 队列Azure Queues 允许应用程序组件之间存在异步消息队列。Allows for asynchronous message queueing between application components. 希望分离应用程序组件,并传递异步消息以实现这些组件间的通信。You want to decouple application components and use asynchronous messaging to communicate between them.

要查看关于何时使用队列存储和服务总线队列的指南,请参阅存储队列和服务总线队列 - 比较与对照For guidance around when to use Queue storage versus Service Bus queues, see Storage queues and Service Bus queues - compared and contrasted.
Azure 表Azure Tables 允许在云中存储结构化 NoSQL 数据,通过无架构设计提供键/属性存储。Allow you to store structured NoSQL data in the cloud, providing a key/attribute store with a schemaless design. 希望存储灵活的数据集,例如 Web 应用程序的用户数据、通讯簿、设备信息,或者服务需要的其他类型的元数据。You want to store flexible datasets like user data for web applications, address books, device information, or other types of metadata your service requires.

要查看关于何时使用表存储与 Azure Cosmos DB 表 API 的指南,请参阅使用 Azure Cosmos DB 表 API 和 Azure 表存储进行开发For guidance around when to use Table storage versus the Azure Cosmos DB Table API, see Developing with Azure Cosmos DB Table API and Azure Table storage.

Blob 存储Blob storage

Azure Blob 存储是 Microsoft 提供的适用于云的对象存储解决方案。Azure Blob storage is Microsoft's object storage solution for the cloud. Blob 存储最适合存储巨量的非结构化数据,例如文本或二进制数据。Blob storage is optimized for storing massive amounts of unstructured data, such as text or binary data.

Blob 存储最适合用于:Blob storage is ideal for:

  • 直接向浏览器提供图像或文档。Serving images or documents directly to a browser.
  • 存储文件以供分布式访问。Storing files for distributed access.
  • 对视频和音频进行流式处理。Streaming video and audio.
  • 存储用于备份和还原、灾难恢复及存档的数据。Storing data for backup and restore, disaster recovery, and archiving.
  • 存储数据以供本地或 Azure 托管服务执行分析。Storing data for analysis by an on-premises or Azure-hosted service.

可以通过 HTTP 或 HTTPS 从世界上的任何位置访问 Blob 存储中的对象。Objects in Blob storage can be accessed from anywhere in the world via HTTP or HTTPS. 用户或客户端应用程序可以通过 URL、Azure 存储 REST APIAzure PowerShellAzure CLI 或 Azure 存储客户端库访问 Blob。Users or client applications can access blobs via URLs, the Azure Storage REST API, Azure PowerShell, Azure CLI, or an Azure Storage client library. 存储客户端库以多种语言提供,包括 .NETJavaNode.jsPythonPHPRubyThe storage client libraries are available for multiple languages, including .NET, Java, Node.js, Python, PHP, and Ruby.

有关 Blob 存储的详细信息,请参阅 Blob 存储简介For more information about Blob storage, see Introduction to Blob storage.

Azure 文件Azure Files

可以通过 Azure 文件设置可用性高的网络文件共享,以便使用标准的服务器消息块 (SMB) 协议对其进行访问。Azure Files enables you to set up highly available network file shares that can be accessed by using the standard Server Message Block (SMB) protocol. 这意味着,多个 VM 可以共享启用了读取和写入访问权限的相同文件。That means that multiple VMs can share the same files with both read and write access. 也可使用 REST 接口或存储客户端库来读取文件。You can also read the files using the REST interface or the storage client libraries.

Azure 文件不同于公司文件共享的一点是,可以在全球任何地方使用 URL 来访问文件,只要该 URL 指向文件且包含共享访问签名 (SAS) 令牌即可。One thing that distinguishes Azure Files from files on a corporate file share is that you can access the files from anywhere in the world using a URL that points to the file and includes a shared access signature (SAS) token. 可以生成 SAS 令牌,用于在指定时间内对私有资产进行特定访问。You can generate SAS tokens; they allow specific access to a private asset for a specific amount of time.

文件共享适用于许多常用方案:File shares can be used for many common scenarios:

  • 许多本地应用程序使用文件共享。Many on-premises applications use file shares. 此功能可以更方便地迁移那些将数据共享到 Azure 的应用程序。This feature makes it easier to migrate those applications that share data to Azure. 如果将文件共享装载到本地应用程序所使用的驱动器号,则应用程序中访问文件共享的那部分应尽量少做更改(如果必须进行更改的话)。If you mount the file share to the same drive letter that the on-premises application uses, the part of your application that accesses the file share should work with minimal, if any, changes.

  • 配置文件可以在一个文件共享上存储,从多个 VM 进行访问。Configuration files can be stored on a file share and accessed from multiple VMs. 可以将一个组中多个开发人员使用的工具和实用程序存储到文件共享中,确保每个人都能找到它们并使用同一版本。Tools and utilities used by multiple developers in a group can be stored on a file share, ensuring that everybody can find them, and that they use the same version.

  • 例如,资源日志、指标和故障转储是三种可以写入到文件共享供以后处理或分析的数据。Resource logs, metrics, and crash dumps are just three examples of data that can be written to a file share and processed or analyzed later.

有关 Azure 文件的详细信息,请参阅 Azure 文件简介For more information about Azure Files, see Introduction to Azure Files.

某些 SMB 功能不适用于云。Some SMB features are not applicable to the cloud. 有关详细信息,请参阅 Features not supported by the Azure File service(Azure 文件服务不支持的功能)。For more information, see Features not supported by the Azure File service.

队列存储Queue storage

Azure 队列服务用于存储和检索消息。The Azure Queue service is used to store and retrieve messages. 队列消息最大可以为 64 KB,一个队列可以包含数百万条消息。Queue messages can be up to 64 KB in size, and a queue can contain millions of messages. 队列通常用于存储需要异步处理的消息的列表。Queues are generally used to store lists of messages to be processed asynchronously.

例如,假设你需要客户能够上传图片,并且你需要创建每个图片的缩略图。For example, say you want your customers to be able to upload pictures, and you want to create thumbnails for each picture. 可以让客户在上传图片时等待你创建缩略图,You could have your customer wait for you to create the thumbnails while uploading the pictures. 也可以使用队列。An alternative would be to use a queue. 当客户完成上传操作后,向队列写入一条消息。When the customer finishes their upload, write a message to the queue. 然后通过 Azure Function 从队列检索该消息并创建缩略图。Then have an Azure Function retrieve the message from the queue and create the thumbnails. 此处理过程的每一部分都可以单独进行缩放,让你可以根据使用情况进行调整,加强控制。Each of the parts of this processing can be scaled separately, giving you more control when tuning it for your usage.

有关 Azure 队列的详细信息,请参阅队列简介For more information about Azure Queues, see Introduction to Queues.

表存储Table storage

Azure 表存储现在是 Azure Cosmos DB 的一部分。Azure Table storage is now part of Azure Cosmos DB. 若要查看 Azure 表存储文档,请参阅 Azure 表存储概述To see Azure Table storage documentation, see the Azure Table Storage Overview. 除了现有的 Azure 表存储服务,还有新的 Azure Cosmos DB 表 API 产品/服务,后者提供吞吐量优化表、全局分发和自动辅助索引。In addition to the existing Azure Table storage service, there is a new Azure Cosmos DB Table API offering that provides throughput-optimized tables, global distribution, and automatic secondary indexes. 要详细了解并尝试新的高级体验,请查看 Azure Cosmos DB 表 APITo learn more and try out the new premium experience, see Azure Cosmos DB Table API.

有关表存储的详细信息,请参阅 Azure 表存储概述For more information about Table storage, see Overview of Azure Table storage.

磁盘存储Disk storage

Azure 托管磁盘是虚拟硬盘 (VHD)。An Azure managed disk is a virtual hard disk (VHD). 可以将其视为本地服务器中的物理磁盘,但它是虚拟化的。You can think of it like a physical disk in an on-premises server but, virtualized. Azure 托管磁盘作为页 blob 存储,后者是 Azure 中的随机 IO 存储对象。Azure-managed disks are stored as page blobs, which are a random IO storage object in Azure. 我们之所以将托管磁盘称为“托管”是因为,它是对页 blob、blob 容器和 Azure 存储帐户的抽象。We call a managed disk 'managed' because it is an abstraction over page blobs, blob containers, and Azure storage accounts. 对于托管磁盘,你所要做的就是预配磁盘,而 Azure 负责其余的工作。With managed disks, all you have to do is provision the disk, and Azure takes care of the rest.

有关托管磁盘的详细信息,请参阅 Azure 托管磁盘简介For more information about managed disks, see Introduction to Azure managed disks.

存储帐户的类型Types of storage accounts

Azure 存储提供多种类型的存储帐户。Azure Storage offers several types of storage accounts. 每种类型支持不同的功能,并且具有自己的定价模型。Each type supports different features and has its own pricing model. 有关存储帐户类型的详细信息,请参阅 Azure 存储帐户概述For more information about storage account types, see Azure storage account overview.

保护对存储帐户的访问Secure access to storage accounts

对 Azure 存储的每个请求必须获得授权。Every request to Azure Storage must be authorized. Azure 存储支持以下授权方法:Azure Storage supports the following authorization methods:

  • 用于 Blob 和队列数据的 Azure Active Directory (Azure AD) 集成。Azure Active Directory (Azure AD) integration for blob and queue data. Azure 存储支持通过基于角色的访问控制 (RBAC) 使用 Azure AD 为 Blob 和队列服务进行身份验证和授权。Azure Storage supports authentication and authorization with Azure AD for the Blob and Queue services via role-based access control (RBAC). 建议使用 Azure AD 进行授权请求,以确保极高的安全性和易用性。Authorizing requests with Azure AD is recommended for superior security and ease of use. 有关详细信息,请参阅使用 Azure Active Directory 对 Azure Blob 和队列访问进行授权For more information, see Authorize access to Azure blobs and queues using Azure Active Directory.
  • 通过共享密钥进行授权。Authorization with Shared Key. Azure 存储 Blob、文件、队列和表服务支持通过共享密钥授权。The Azure Storage Blob, Files, Queue, and Table services support authorization with Shared Key. 使用共享密钥授权的客户端会随使用存储帐户访问密钥签名的每个请求传递一个标头。A client using Shared Key authorization passes a header with every request that is signed using the storage account access key. 有关详细信息,请参阅通过共享密钥进行授权For more information, see Authorize with Shared Key.
  • 使用共享访问签名 (SAS) 进行授权。Authorization using shared access signatures (SAS). 共享访问签名 (SAS) 是一个字符串,其中包含的安全令牌可以追加到存储资源的 URI。A shared access signature (SAS) is a string containing a security token that can be appended to the URI for a storage resource. 安全令牌封装了各种约束,例如权限、访问时间间隔。The security token encapsulates constraints such as permissions and the interval of access. 有关详细信息,请参阅使用共享访问签名 (SAS)For more information, see Using Shared Access Signatures (SAS).
  • 对容器和 Blob 的匿名访问。Anonymous access to containers and blobs. 容器及其 Blob 也许可以公开使用。A container and its blobs may be publicly available. 指定某个容器或 Blob 为公用的时,任何人都可以匿名读取它,不需要进行身份验证。When you specify that a container or blob is public, anyone can read it anonymously; no authentication is required. 有关详细信息,请参阅管理对容器和 Blob 的匿名读取访问For more information, see Manage anonymous read access to containers and blobs.

EncryptionEncryption

有两种适用于核心存储服务的基本加密类型。There are two basic kinds of encryption available for the core storage services. 若要详细了解安全性和加密,请参阅 Azure 存储安全指南For more information about security and encryption, see the Azure Storage security guide.

静态加密Encryption at rest

Azure 存储加密可保护数据,使组织能够信守在安全性与合规性方面作出的承诺。Azure Storage encryption protects and safeguards your data to meet your organizational security and compliance commitments. Azure 存储先自动加密所有数据,再将数据保存到存储帐户,然后在检索之前解密数据。Azure Storage automatically encrypts all data prior to persisting to the storage account and decrypts it prior to retrieval. 加密、解密和密钥管理过程对用户透明。The encryption, decryption, and key management processes are transparent to users. 客户也可选择使用 Azure Key Vault 管理自己的密钥。Customers can also choose to manage their own keys using Azure Key Vault. 有关详细信息,请参阅静态数据的 Azure 存储加密For more information, see Azure Storage encryption for data at rest.

客户端加密Client-side encryption

Azure 存储客户端库提供的方法用于加密客户端库的数据,然后通过网络发送数据并解密响应。The Azure Storage client libraries provide methods for encrypting data from the client library before sending it across the wire and decrypting the response. 通过客户端加密加密的数据也通过 Azure 存储进行静态加密。Data encrypted via client-side encryption is also encrypted at rest by Azure Storage. 有关客户端加密的详细信息,请参阅 Azure 存储的使用 .NET 的客户端加密For more information about client-side encryption, see Client-side encryption with .NET for Azure Storage.

冗余Redundancy

为了确保数据的持久性,Azure 存储会存储多个数据副本。To ensure that your data is durable, Azure Storage stores multiple copies of your data. 设置存储帐户时,可选择冗余选项。When you set up your storage account, you select a redundancy option. 有关详细信息,请参阅 Azure 存储冗余For more information, see Azure Storage redundancy.

将数据传入和传出 Azure 存储Transfer data to and from Azure Storage

有多个选项用于将数据移入或移出 Azure 存储。You have several options for moving data into or out of Azure Storage. 选择哪个选项取决于数据集的大小和网络带宽。Which option you choose depends on the size of your dataset and your network bandwidth. 有关详细信息,请参阅选择 Azure 数据传输解决方案For more information, see Choose an Azure solution for data transfer.

定价Pricing

决定如何存储和访问数据时,还应考虑涉及的成本。When making decisions about how your data is stored and accessed, you should also consider the costs involved. 有关详细信息,请参阅 Azure 存储定价For more information, see Azure Storage pricing.

存储 API、库和工具Storage APIs, libraries, and tools

可以通过发出 HTTP/HTTPS 请求时采用的任何语言来访问存储帐户中的资源。You can access resources in a storage account by any language that can make HTTP/HTTPS requests. 另外,核心 Azure 存储服务还为多种主流语言提供了编程库。Additionally, the core Azure Storage services offer programming libraries for several popular languages. 这些库通过对细节进行处理简化了使用 Azure 存储的许多方面,这些细节包括同步和异步调用、操作的批处理、异常管理、自动重试、操作行为,等等。These libraries simplify many aspects of working with Azure Storage by handling details such as synchronous and asynchronous invocation, batching of operations, exception management, automatic retries, operational behavior, and so forth. 这些库当前可供下列语言和平台以及正在筹备的其他语言和平台使用:Libraries are currently available for the following languages and platforms, with others in the pipeline:

Azure 存储数据 API 和库参考Azure Storage data API and library references

Azure 存储管理 API 和库参考Azure Storage management API and library references

Azure 存储数据移动 API 和库参考Azure Storage data movement API and library references

工具和实用程序Tools and utilities

后续步骤Next steps

要启动并运行核心 Azure 存储服务,请参阅创建存储帐户To get up and running with core Azure Storage services, see Create a storage account.