REST API Reference for Azure Blob Storage
This document provides a comprehensive reference for the Azure Blob Storage REST API. The Blob Storage service is an object storage solution for saving and retrieving massive amounts of unstructured data like text or binary data.
You can interact with the Blob Storage service by using the REST API directly, or by using one of the Azure Storage client libraries, which provide convenient wrappers for the REST API.
General Information
- Base URL:
https://{account-name}.blob.core.windows.net
- Authentication: Shared Key or Azure Active Directory.
- API Version: Always specify the API version in your requests. The current stable version is typically denoted as
api-version=2020-08-04 or later.
Core Resources
The Azure Blob Storage service organizes data hierarchically: Storage Account > Container > Blob.
List Containers
This operation lists all containers within a storage account.
Request Headers
Query Parameters
| Name |
Type |
Description |
Required |
comp |
String |
Must be set to list. |
Yes |
prefix |
String |
Filters the results to return only containers whose names begin with the specified prefix. |
No |
marker |
String |
A string value that identifies the position in the list of all containers to begin the listing. |
No |
maxresults |
Integer |
Specifies the maximum number of containers to return. |
No |
Responses
| Status Code |
Description |
200 OK |
Success. Returns a list of containers. |
403 Forbidden |
Authentication or authorization failure. |
404 Not Found |
Storage account not found. |
Example Response (JSON)
{
"Container": [
{
"Name": "mycontainer1",
"Properties": {
"LastModified": "2023-10-27T10:00:00Z",
"Etag": "\"0x8D9A1B2C3D4E5F6\""
}
},
{
"Name": "anothercontainer",
"Properties": {
"LastModified": "2023-10-26T15:30:00Z",
"Etag": "\"0x8D9A1B2C3D4E5F7\""
}
}
]
}
Create Container
This operation creates a new container within a storage account.
Request Headers
Responses
| Status Code |
Description |
201 Created |
Success. The container was created. |
403 Forbidden |
Authentication or authorization failure. |
409 Conflict |
Container with the same name already exists. |
Put Blob
This operation creates a new block blob, or updates an existing block blob.
Request Headers
Request Body
The content of the blob.
Responses
| Status Code |
Description |
201 Created |
Success. The blob was created or updated. |
403 Forbidden |
Authentication or authorization failure. |
404 Not Found |
Container or account not found. |
Get Blob
This operation retrieves a blob.
Request Headers
Query Parameters
| Name |
Type |
Description |
Required |
snapshot |
String |
Specifies a snapshot time for the blob. |
No |
Responses
| Status Code |
Description |
200 OK |
Success. Returns the blob content. |
403 Forbidden |
Authentication or authorization failure. |
404 Not Found |
Blob or container not found. |
Example Response (Blob Content)
This is the content of my blob file.
Delete Blob
This operation deletes a blob.
Request Headers
Query Parameters
| Name |
Type |
Description |
Required |
snapshot |
String |
Specifies a snapshot time for the blob to delete. |
No |
Responses
| Status Code |
Description |
204 No Content |
Success. The blob was deleted. |
403 Forbidden |
Authentication or authorization failure. |
404 Not Found |
Blob or container not found. |