Soenneker.Blob.Copy
11.0.1139
Prefix Reserved
dotnet add package Soenneker.Blob.Copy --version 11.0.1139
NuGet\Install-Package Soenneker.Blob.Copy -Version 11.0.1139
<PackageReference Include="Soenneker.Blob.Copy" Version="11.0.1139" />
<PackageVersion Include="Soenneker.Blob.Copy" Version="11.0.1139" />
<PackageReference Include="Soenneker.Blob.Copy" />
paket add Soenneker.Blob.Copy --version 11.0.1139
#r "nuget: Soenneker.Blob.Copy, 11.0.1139"
#:package Soenneker.Blob.Copy@11.0.1139
#addin nuget:?package=Soenneker.Blob.Copy&version=11.0.1139
#tool nuget:?package=Soenneker.Blob.Copy&version=11.0.1139
Soenneker.Blob.Copy
Starts an Azure server-side blob copy, waits for completion, and skips missing sources, self-copies, and destinations with the same content hash.
Install
dotnet add package Soenneker.Blob.Copy
Register the stateless utility in Program.cs:
using Soenneker.Blob.Copy.Registrars;
builder.Services.AddBlobCopyAsSingleton();
Scoped registration is also available.
Copy a blob
using Azure.Storage.Blobs.Models;
using Soenneker.Blob.Copy.Abstract;
CopyFromUriOperation? operation = await blobCopy.ServerSideBlobCopy(
sourceBlob,
destinationBlob,
cancellationToken);
if (operation is null)
{
// The source was missing, the URIs targeted the same blob,
// or both blobs exposed the same non-empty content hash.
}
The destination container is created privately if it does not exist. An existing destination blob is replaced by the Azure copy operation; it is not deleted first, so a failure to start the copy does not create an avoidable delete-before-copy gap.
Source authorization
Azure Storage performs the transfer, so the service must be able to read the source URI:
- If
source.CanGenerateSasUriis true, the utility generates a read-only SAS valid for one hour. - Otherwise, the source URI is passed as-is. It must already contain usable authorization or identify a publicly readable blob.
The source credential must also allow reading properties because the utility checks existence and may compare content hashes. The destination client must allow container creation, property reads, and blob writes.
Full source and destination query strings are never written to this utility's logs, preventing SAS tokens from being exposed there.
Result and failure behavior
The returned
CopyFromUriOperationhas reached a terminal status when the method returns.A missing source or skipped copy returns
null; it is not treated as an exception.Matching content is skipped only when both blobs expose non-empty content hashes. If hashes are absent or properties cannot be compared, the copy proceeds.
The utility polls for up to five minutes. A timeout stops waiting but does not guarantee Azure stopped the server-side copy.
A non-success Azure copy status throws
InvalidOperationException; Azure request failures propagate asRequestFailedException.Cancellation stops pending work; it does not undo work that has already completed.
Cancellation after Azure accepts the copy may leave a server-side operation running. Inspect or abort the destination copy explicitly when that distinction matters.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Azure.Storage.Blobs (>= 12.30.1)
- Soenneker.Extensions.Task (>= 11.0.143)
- Soenneker.Extensions.ValueTask (>= 11.0.136)
- Soenneker.Utils.Delay (>= 11.0.110)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blob.Copy:
| Package | Downloads |
|---|---|
|
Soenneker.Blob.Suite
A concoction of Azure Blob Storage utilities and libraries |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.1139 | 168 | 11/11/2026 |
| 11.0.1138 | 103 | 11/11/2026 |
| 11.0.1136 | 97 | 11/11/2026 |
| 11.0.1135 | 109 | 11/10/2026 |
| 11.0.1134 | 419 | 11/3/2026 |
| 11.0.1133 | 227 | 10/27/2026 |
| 11.0.1132 | 164 | 10/26/2026 |
| 11.0.1131 | 132 | 10/26/2026 |
| 11.0.1130 | 128 | 10/26/2026 |
| 11.0.1128 | 120 | 10/26/2026 |
| 4.0.1127 | 134 | 10/26/2026 |
| 4.0.1126 | 598 | 10/15/2026 |
| 4.0.1125 | 140 | 10/14/2026 |
| 4.0.1124 | 126 | 10/14/2026 |
| 4.0.1123 | 133 | 10/14/2026 |
| 4.0.1121 | 117 | 10/14/2026 |
| 4.0.1120 | 99 | 10/14/2026 |
| 4.0.1114 | 142 | 10/13/2026 |
| 4.0.1111 | 132 | 10/12/2026 |
| 4.0.1109 | 114 | 10/12/2026 |
Updated Multiple NuGet packages