Incremental Copy Blob
Incremental Copy Blob operation copies a snapshot of the source page blob to a destination page blob. Only the differences from the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot, and you can read or copy from them as usual. This API is supported since REST version 2016-05-31.
You can construct the
Incremental Copy Blob request as follows. HTTPS is recommended. Replace myaccount with the name of your storage account, mycontainer with the name of your container, and myblob with the name of your destination blob. The
comp query parameter, with value of
incrementalcopy, indicates that this request is to create an incremental snapshot.
|PUT method request URI||HTTP version|
Emulated storage service URI
When you make a request against the emulated storage service, specify the emulator hostname and Azure Blob Storage service port as 127.0.0.1:10000, followed by the emulated storage account name. Also indicate that this request is for incremental copy, by setting the
comp query parameter to
|PUT method request URI||HTTP version|
For more information, see Use Azurite emulator for local Azure Storage development.
You can specify the following additional parameters on the request URI.
The following table describes required and optional request headers.
||Required. Specifies the authorization scheme, account name, and signature. For more information, see Authorize requests to Azure Storage.|
||Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.|
||Required for all authorized requests, and optional for anonymous requests. Specifies the version of the operation to use for this request. For more information, see Versioning for the Azure Storage services.|
Specify the wildcard character (
If the specified condition isn't met, Blob Storage returns status code 412 (Precondition Failed).
||Required. Specifies the name of the source page blob snapshot.
This value is a URL of up to 2 kibibytes (KiB) in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob URI can be authorized in one of two ways:
The source blob URI can reference a page blob snapshot, but it must include a shared access signature (SAS) token that was created on the snapshot's base blob. The signed resource (
The source blob URI can reference a public page blob snapshot; for example,
||Optional. Provides a client-generated, opaque value with a 1-KiB character limit that's recorded in the logs when logging is configured. We highly recommend that you use this header to correlate client-side activities with requests that the server receives. For more information, see Monitor Azure Blob Storage.|
The response includes an HTTP status code, and a set of response headers.
A successful operation returns status code 202 (Accepted). For information about status codes, see Status and error codes.
The response for this operation includes the following headers. The response can also include additional, standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
||Contains a value that you can use to perform operations conditionally. The value is in quotes.|
||The date and time that the blob was last modified. For more information, see Representation of date/time values in headers.
Any write operation on the blob (including updates on the blob's metadata or properties) changes the last-modified time of the blob.
||Uniquely identifies the request that was made and can be used for troubleshooting the request. For more information, see Troubleshooting API operations.|
||Indicates the version of Blob Storage used to run the request.|
||A UTC date/time value that indicates the time at which the response was initiated. The service generates this value.|
||The string identifier for this copy operation. Use with
||The state of the copy operation. This is always pending, to indicate that the copy has started and is in progress.|
||Can be used to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the
The following is a sample response for a request to perform an incremental copy:
Response Status: HTTP/1.1 202 Accepted Response Headers: Last-Modified: <date> ETag: "0x8CEB669D794AFE2" Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: cc6b209a-b593-4be1-a38a-dde7c106f402 x-ms-version: 2016-05-31 x-ms-copy-id: 1f812371-a41d-49e6-b123-f4b542e851c5 x-ms-copy-status: pending Date: <date>
Authorization is required when calling any data access operation in Azure Storage. The following section describes how the destination object for the
Incremental Copy Blob operation can be authorized. Access to the source blob or file is authorized separately, as described in the details for the
x-ms-copy-source request header.
Azure Storage supports using Microsoft Entra ID to authorize requests to blob data. With Microsoft Entra ID, you can use Azure role-based access control (Azure RBAC) to grant permissions to a security principal. The security principal may be a user, group, application service principal, or Azure managed identity. The security principal is authenticated by Microsoft Entra ID to return an OAuth 2.0 token. The token can then be used to authorize a request against the Blob service.
To learn more about authorization using Microsoft Entra ID, see Authorize access to blobs using Microsoft Entra ID.
Listed below are the RBAC action necessary for a Microsoft Entra user, group, or service principal to call the
Incremental Copy Blob operation, and the least privileged built-in Azure RBAC role that includes this action:
- Azure RBAC action: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write (for writing to an existing blob) or Microsoft.Storage/storageAccounts/blobServices/containers/blobs/add/action (for writing a new blob to the destination)
- Least privileged built-in role: Storage Blob Data Contributor
To learn more about assigning roles using Azure RBAC, see Assign an Azure role for access to blob data.
The destination of an incremental copy must either not exist, or must have been created with a previous incremental copy from the same source blob. After you create it, the destination blob is permanently associated with the source, and can only be used for incremental copies. The
Get Blob Properties and
List Blobs APIs indicate whether the blob is an incremental copy blob created in this way.
You can't directly download incremental copy blobs. The only supported operations are
Get Blob Properties,
Incremental Copy Blob, and
Delete Blob. You can read and delete the copied snapshots as usual.
You perform an incremental copy asynchronously on the service, and you must poll for completion. Refer to the
Copy Blob API for details on how to poll a pending copy. When the copy completes, the destination blob will contain a new snapshot. The
Get Blob Properties API returns the snapshot time of the newly created snapshot.
The first time you perform an incremental copy on a destination blob, a new blob is created, with a snapshot that is fully copied from the source. Each subsequent call to
Incremental Copy Blob creates a new snapshot, by copying only the differential changes from the previously copied snapshot.
The differential changes are computed on the server by issuing a
Get Page Ranges call on the source blob snapshot. Set
prevsnapshot to the most recently copied snapshot. Therefore, the same restrictions on
Get Page Ranges apply to
Incremental Copy Blob. Specifically, you must copy snapshots in ascending order, and if the source blob is re-created by using
Put Blob or
Copy Blob, then
Incremental Copy Blob on new snapshots will fail.
The additional storage space consumed by the copied snapshot is the size of the differential data transferred during the copy. You can determine this size by performing a differential
Get Page Ranges API call on the snapshot, to compare it to the previous snapshot.