您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Blob 服务 REST APIBlob service REST API

Blob 服务将文本和二进制数据存储为云中的对象。The Blob service stores text and binary data as objects in the cloud. BLOB 服务提供以下三种资源:存储帐户、容器和 Blob。The Blob service offers the following three resources: the storage account, containers, and blobs. 在存储帐户中,容器提供组织 Blob 集的方法。Within your storage account, containers provide a way to organize sets of blobs.

可以在以下几种类型的 Blob 之一中存储文本和二进制数据:You can store text and binary data in one of the following types of blobs:

  • 块 Blob,针对流进行了优化。Block blobs, which are optimized for streaming.

  • 追加为追加操作而优化的 blob。Append blobs, which are optimized for append operations.

  • 页 Blob,针对随机读取/写入操作进行了优化,并提供了在 Blob 中写入一定范围字节的功能。Page blobs, which are optimized for random read/write operations and which provide the ability to write to a range of bytes in a blob.

有关块 blob 和页 blob 的详细信息,请参阅了解块 blob、追加 blob 和页 blobFor more information about block blobs and page blobs, see Understanding Block Blobs, Append Blobs, and Page Blobs.

Blob 服务的 REST API 针对存储帐户、容器和 blob 定义 HTTP 操作。The REST API for the Blob service defines HTTP operations against the storage account, containers, and blobs. 该 API 包括下表中列出的操作。The API includes the operations listed in the following table.

OperationOperation 资源类型Resource Type 描述Description
列出容器List Containers 帐户Account 列出存储帐户中的所有容器。Lists all of the containers in a storage account.
设置 Blob 服务属性Set Blob Service Properties 帐户Account 设置 BLOB 服务的属性,包括日志记录和度量设置以及默认服务版本。Sets the properties of the Blob service, including logging and metrics settings, and the default service version.
获取 Blob 服务属性Get Blob Service Properties 帐户Account 获 BLOB 服务的属性,包括日志记录和度量设置以及默认服务版本。Gets the properties of the Blob service, including logging and metrics settings, and the default service version.
预检 Blob 请求Preflight Blob Request 帐户Account 在发送实际请求之前,查询 Blob 服务的跨域资源共享 (CORS) 规则。Queries the Cross-Origin Resource Sharing (CORS) rules for the Blob service prior to sending the actual request.
获取 Blob 服务统计信息Get Blob Service Stats 帐户Account 检索与 Blob 服务的复制有关的统计信息。Retrieves statistics related to replication for the Blob service. 仅在为存储帐户启用了读访问的地域冗余复制时,才能在辅助位置的终结点上使用此操作。This operation is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.
获取帐户信息Get Account Information 帐户Account 返回指定帐户的 SKU 名称和帐户类型。Returns the SKU name and account kind for the specified account.
获取用户委托密钥Get User Delegation Key 帐户Account 获取可用于对用户委托 SAS (共享访问签名)进行签名的密钥。Gets a key that can be used to sign a user delegation SAS (shared access signature). 用户委托 SAS 使用 Azure Active Directory (Azure AD)凭据授予对 Blob 服务中的资源的访问权限。A user delegation SAS grants access to resources in the Blob service using Azure Active Directory (Azure AD) credentials.
创建容器Create Container 容器Container 在存储帐户中新建一个容器。Creates a new container in a storage account.
获取容器属性Get Container Properties 容器Container 返回容器的所有用户定义的元数据和系统属性。Returns all user-defined metadata and system properties of a container.
获取容器元数据Get Container Metadata 容器Container 仅返回容器的用户定义的元数据。Returns only user-defined metadata of a container.
设置容器元数据Set Container Metadata 容器Container 设置容器的用户定义元数据。Sets user-defined metadata of a container.
获取容器 ACLGet Container ACL 容器Container 为容器获取公共访问策略和任何存储访问策略。Gets the public access policy and any stored access policies for the container.
Set Container ACLSet Container ACL 容器Container 为容器设置公共访问策略和任何存储访问策略。Sets the public access policy and any stored access policies for the container.
Lease Container(租赁容器)Lease Container 容器Container 针对删除操作建立并管理容器上的锁。Establishes and manages a lock on a container for delete operations.
删除容器Delete Container 容器Container 删除容器及它所包含的所有 Blob。Deletes the container and any blobs that it contains.
列出 BlobList Blobs 容器Container 列出容器中的所有 Blob。Lists all of the blobs in a container.
放置 BlobPut Blob 块、追加和页 blobBlock, append, and page blobs 在容器中创建新的 Blob 或替换现有的 Blob。Creates a new blob or replaces an existing blob within a container.
获取 BlobGet Blob 块、追加和页 blobBlock, append, and page blobs 从 BLOB 服务读取或下载 Blob,包括其用户定义的元数据和系统属性。Reads or downloads a blob from the Blob service, including its user-defined metadata and system properties.
获取 Blob 属性Get Blob Properties 块、追加和页 blobBlock, append, and page blobs 返回 Blob 中的所有系统属性和用户定义元数据。Returns all system properties and user-defined metadata on the blob.
设置 Blob 属性Set Blob Properties 块、追加和页 blobBlock, append, and page blobs 设置为现有 Blob 定义的系统属性。Sets system properties defined for an existing blob.
获取 Blob 元数据Get Blob Metadata 块、追加和页 blobBlock, append, and page blobs 检索现有 Blob 或快照的所有用户定义元数据。Retrieves all user-defined metadata of an existing blob or snapshot.
设置 Blob 元数据Set Blob Metadata 块、追加和页 blobBlock, append, and page blobs 设置现有 Blob 的用户定义元数据。Sets user-defined metadata of an existing blob.
获取 Blob 标记Get Blob Tags 块、追加和页 blobBlock, append, and page blobs 检索现有 blob 的用户定义的标记。Retrieves user-defined tags of an existing blob.
设置 Blob 标记Set Blob Tags 块、追加和页 blobBlock, append, and page blobs 设置构成辅助索引的现有 blob 的用户定义的标记。Sets user-defined tags of an existing blob that form a secondary index.
按标记查找 BlobFind Blobs By Tags 块、追加和页 blobBlock, append, and page blobs 按用户定义的标记列出 blob。Lists blobs by their user-defined tags.
删除 BlobDelete Blob 块 Blob、追加 Blob 和页 BlobBlock, append and page blobs 标记 Blob 以供删除。Marks a blob for deletion.
删除 BlobUndelete Blob 块 Blob、追加 Blob 和页 BlobBlock, append and page blobs 还原软删除 blob 的内容和元数据和/或所有关联的软删除快照。Restores the contents and metadata of soft deleted blob and/or all associated soft deleted snapshots.
租用 BlobLease Blob 块、追加和页 blobBlock, append, and page blobs 在写入和删除操作上设置和管理锁定。Establishes and manages a lock on write and delete operations. 要删除或写入到锁定的 Blob,客户端必须提供租约 ID。To delete or write to a locked blob, a client must provide the lease ID.
快照 BlobSnapshot Blob 块、追加和页 blobBlock, append, and page blobs 创建 Blob 的只读快照。Creates a read-only snapshot of a blob.
复制 BlobCopy Blob 块、追加和页 blobBlock, append, and page blobs 将源 Blob 复制到此存储帐户或另一个存储帐户中的目标 Blob。Copies a source blob to a destination blob in this storage account or in another storage account.
中止复制 BlobAbort Copy Blob 块、追加和页 blobBlock, append, and page blobs 中止挂起的Copy Blob 操作,并使目标 Blob 具有零长度和完整元数据。Aborts a pending Copy Blob operation, and leaves a destination blob with zero length and full metadata.
放置块Put Block 仅块 BlobBlock blobs only 创建新块,作为块 blob 的一部分进行提交。Creates a new block to be committed as part of a block blob.
从 URL 放置块Put Block From URL 仅块 BlobBlock blobs only 创建一个新块作为块 blob 的一部分提交,其中的内容是从 URL 中读取的。Creates a new block to be committed as part of a block blob where the contents are read from a URL.
放置块列表Put Block List 仅块 BlobBlock blobs only 通过指定构成块 blob 的块 ID 集来提交 blob。Commits a blob by specifying the set of block IDs that comprise the block blob.
获取阻止列表Get Block List 仅块 BlobBlock blobs only 检索作为块 Blob 一部分上载的块的列表。Retrieves the list of blocks that have been uploaded as part of a block blob.
查询 Blob 内容Query Blob Contents 仅块 BlobBlock blobs only 对 blob 的内容应用简单的结构化查询语言(SQL)语句,并仅返回查询的数据子集。Applies a simple Structured Query Language (SQL) statement on a blob's contents and returns only the queried subset of the data.
设置 Blob 层Set Blob Tier 块和页 BlobBlock and page blobs 设置 blob 的层。Sets the tier of a blob.
放置页Put Page 仅页 BlobPage blobs only 将一定范围的页面写入到页 Blob 中。Writes a range of pages into a page blob.
获取页范围Get Page Ranges 仅页 BlobPage blobs only 返回页 Blob 或页 Blob 快照的有效页面范围的列表。Returns a list of valid page ranges for a page blob or a snapshot of a page blob.
增量复制 BlobIncremental Copy Blob 仅页 BlobPage blobs only 将源页 blob 的快照复制到目标页 blob。Copies a snapshot of a source page blob to a destination page blob. 仅传输差异更改。Only differential changes are transferred.
追加块Append Block 仅追加 BlobAppend blobs only 将数据块写入追加 blob 的末尾。Writes a block of data to the end of an append blob.

本节内容In this section

Blob 服务概念Blob Service Concepts

对帐户的操作(BLOB 服务)Operations on the Account (Blob Service)

容器上的操作Operations on Containers

Blob 上的操作Operations on Blobs

请参阅See also

存储服务 RESTStorage Services REST