The Azure Blob Storage service offers a RESTful API that allows you to programmatically interact with your blob data. This API supports common HTTP operations for managing containers and blobs.
This documentation provides detailed information on the various REST operations, their request and response formats, parameters, and error codes. You can use this API directly or via one of the Azure SDKs.
Operation | HTTP Method | Description | Resource |
---|---|---|---|
List Containers | GET | Lists all containers in a storage account. | / |
Create Container | PUT | Creates a new container in a storage account. | / |
Delete Container | DELETE | Deletes a container and all its blobs. | / |
List Blobs | GET | Lists all blobs within a container. | / |
Upload Blob | PUT | Uploads a block blob. | / |
Download Blob | GET | Downloads a blob. | / |
Delete Blob | DELETE | Deletes a blob. | / |
Get Blob Properties | HEAD | Retrieves metadata and properties for a blob. | / |
All REST API requests to Azure Blob Storage must be authenticated. Common authentication methods include:
Refer to the Azure Storage authentication documentation for detailed guidance.
Key request headers include:
x-ms-version
: Specifies the version of the Blob service API.Content-Type
: The MIME type of the blob content.Content-Length
: The size of the blob in bytes.Authorization
: For shared key or SAS authentication.Common response headers include:
ETag
: An entity tag for the blob.Last-Modified
: The date and time the blob was last modified.x-ms-request-id
: A unique identifier for the request.Azure Blob Storage returns standard HTTP status codes. Specific error details are provided in the response body, often in an XML format, including an error code and a description.
Common status codes:
200 OK
: The request was successful.201 Created
: The resource was successfully created.204 No Content
: The request was successful, but there was no content to return.400 Bad Request
: The request was malformed.403 Forbidden
: Authentication failed or insufficient permissions.404 Not Found
: The requested resource could not be found.409 Conflict
: The resource already exists or a conflict occurred.Lists all containers in the specified storage account.
Method: GET
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/?comp=list
Query Parameters:
prefix
: Filters results to containers whose names begin with the specified string.include=metadata
: Includes container metadata in the response.maxresults
: Specifies the maximum number of containers to return.marker
: A string value that identifies the position in the list of containers at which to begin the listing.Creates a new container within the specified storage account.
Method: PUT
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
Request Headers:
x-ms-blob-public-access
: Specifies the public access level for the container (e.g., blob
, container
, or none
).x-ms-meta-<name>
: User-defined metadata key-value pairs.Deletes the specified container and all the blobs within it.
Method: DELETE
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
Query Parameters:
x-ms-lease-id
: If the container has an active lease, you must specify the valid lease ID to delete the container.Lists the blobs within the specified container.
Method: GET
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
?comp=list
Query Parameters:
prefix
: Filters results to blobs whose names begin with the specified string.delimiter
: Used to group blobs by logical folder.include
: Optional. Can be one or more of the following comma-separated values: copy
, deleted
, metadata
, snapshots
, uncommittedblobs
.maxresults
: Specifies the maximum number of blobs to return.marker
: A string value that identifies the position in the list of blobs at which to begin the listing.Uploads a block blob to the specified container.
Method: PUT
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
/<blob-name>
Request Headers:
x-ms-blob-type
: Specifies the type of blob to upload (BlockBlob
, AppendBlob
, PageBlob
).Content-Type
: The MIME type of the blob.x-ms-blob-content-encoding
, x-ms-blob-content-language
, x-ms-blob-content-md5
, x-ms-blob-content-type
, x-ms-blob-cache-control
: Blob system properties.x-ms-meta-<name>
: User-defined metadata.Downloads a blob from the specified container.
Method: GET
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
/<blob-name>
Query Parameters:
snapshot
: Specifies a snapshot time for the blob.format
: For page blobs, specifies the format of the blob (page
or block
).Request Headers:
x-ms-range
: Specifies a byte range to download.If-Match
, If-None-Match
, If-Modified-Since
, If-Unmodified-Since
: Conditional headers for the download.Deletes the specified blob.
Method: DELETE
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
/<blob-name>
Query Parameters:
snapshot
: Specifies a snapshot time for the blob to delete.x-ms-lease-id
: If the blob has an active lease, you must specify the valid lease ID.x-ms-delete-snapshots
: Specifies whether to delete blobs snapshots along with the blob. Allowed values: include
or only
.Retrieves system properties for the specified blob. This operation does not return the blob's content.
Method: HEAD
Resource URI:
https://<storage-account-name>
.blob.core.windows.net/<container-name>
/<blob-name>
Query Parameters:
snapshot
: Specifies a snapshot time for the blob.