Azure Blob Storage REST API Reference

This document provides detailed reference information for the Azure Blob Storage REST API. The Blob service supports uploading and downloading binary data, often referred to as blobs.

Get Blob Properties

HEAD /{{account-name}}/{{container-name}}/{{blob-name}}

Retrieves the properties of a blob.

Parameters

Name Type Location Description Required
comp String Query properties Yes
timeout Integer Query Specifies the timeout parameter in seconds. No
snapshot DateTime Query Specifies a snapshot time. No
versionid String Query Specifies a version ID. No

Responses

Code Description
200 OK The blob properties were successfully retrieved.
404 Not Found The specified blob or container does not exist.

Get Blob

GET /{{account-name}}/{{container-name}}/{{blob-name}}

Retrieves a blob from Azure Blob Storage.

Parameters

Name Type Location Description Required
timeout Integer Query Specifies the timeout parameter in seconds. No
snapshot DateTime Query Specifies a snapshot time. No
versionid String Query Specifies a version ID. No
range String Header Specifies the byte range to retrieve. No
x-ms-lease-id String Header Specifies an active lease on the blob. No

Responses

Code Description
200 OK The blob content was successfully retrieved.
206 Partial Content A portion of the blob content was retrieved.
404 Not Found The specified blob or container does not exist.
412 Precondition Failed A specified condition failed.

Put Blob

PUT /{{account-name}}/{{container-name}}/{{blob-name}}

Creates or replaces a blob in a container.

Parameters

Name Type Location Description Required
timeout Integer Query Specifies the timeout parameter in seconds. No
content-type String Header Specifies the MIME type of the blob. No
content-encoding String Header Specifies the content encoding of the blob. No
content-language String Header Specifies the content language of the blob. No
cache-control String Header Specifies the cache control behavior of the blob. No
content-disposition String Header Specifies the content disposition of the blob. No
x-ms-blob-type String Header Specifies the blob type (BlockBlob, PageBlob, AppendBlob). Yes
x-ms-blob-content-md5 String Header Specifies the MD5 hash of the blob content. No
x-ms-lease-id String Header Specifies an active lease on the blob. No
x-ms-blob-condition-appendpos Integer Header Condition for append blobs. No
x-ms-blob-condition-maxsize Integer Header Condition for page blobs. No

Responses

Code Description
201 Created The blob was successfully created or replaced.
200 OK The blob was successfully updated (e.g., metadata).
400 Bad Request The request was invalid.
412 Precondition Failed A specified condition failed.

Delete Blob

DELETE /{{account-name}}/{{container-name}}/{{blob-name}}

Deletes a blob from a container.

Parameters

Name Type Location Description Required
timeout Integer Query Specifies the timeout parameter in seconds. No
snapshot DateTime Query Specifies a snapshot time. No
x-ms-lease-id String Header Specifies an active lease on the blob. No
x-ms-delete-snapshot String Query Specifies whether to delete snapshots along with the blob. No

Responses

Code Description
202 Accepted The blob was successfully deleted.
404 Not Found The specified blob or container does not exist.
409 Conflict The blob is currently leased.
412 Precondition Failed A specified condition failed.

List Blobs

GET /{{account-name}}/{{container-name}}

Lists the blobs within a container.

Parameters

Name Type Location Description Required
comp String Query list Yes
prefix String Query Filters blobs whose names begin with the specified prefix. No
delimiter String Query A delimiter that is used to group blobs. No
maxresults Integer Query Specifies the maximum number of blobs to return. No
include String Query Specifies that snapshots, metadata, or uncommitted blobs should be included. No
marker String Query Specifies a string value that identifies the position in the list of blobs at which to start listing. No
timeout Integer Query Specifies the timeout parameter in seconds. No

Responses

Code Description
200 OK The list of blobs was successfully retrieved.
404 Not Found The specified container does not exist.
409 Conflict The container is not yet available.

Create Container

PUT /{{account-name}}/{{container-name}}

Creates a new container in the specified storage account.

Parameters

Name Type Location Description Required
timeout Integer Query Specifies the timeout parameter in seconds. No
x-ms-blob-public-access String Header Specifies whether data in the container may be accessed publicly and the level of access. Possible values: blob, container, off. No
x-ms-default-encryption-scope String Header Specifies the default encryption scope for blobs in the container. No
x-ms-deny-encryption-scope-override Boolean Header Specifies whether to deny encryption scope override. No
x-ms-lease-id String Header Specifies an active lease on the container. No

Responses

Code Description
201 Created The container was successfully created.
400 Bad Request The request was invalid.
409 Conflict The container already exists.

Delete Container

DELETE /{{account-name}}/{{container-name}}

Deletes a container and all its contents from Azure Blob Storage.

Parameters

Name Type Location Description Required
timeout Integer Query Specifies the timeout parameter in seconds. No
x-ms-lease-id String Header Specifies an active lease on the container. No

Responses

Code Description
202 Accepted The container was successfully deleted.
404 Not Found The specified container does not exist.
409 Conflict The container is currently leased.