Skip to content

[BUG] Breaking change in UploadPages API #41894

@madelson

Description

@madelson

Library name and version

Azure.Storage.Blobs 12.14.0+

Describe the bug

In 12.13.1 and prior, the following line of code compiled:

PageBlobClient client = new(...);
// this line
client.UploadPages(new MemoryStream(new byte[BlobSize]), offset: 0, conditions: new PageBlobRequestConditions { LeaseId = leaseId });

However, starting in 12.14.0, this line fails to compile with the following error message:

C:\...\MyFile.cs(113,26): error CS7036: There is no argument given that corresponds to the required parameter 'transactionalContentHash' of 'PageBlobClient.UploadPages(Stream, long, byte[], PageBlobRequestConditions, IProgress<long>, CancellationToken)' [C:\...\MyProject.csproj::TargetFramework=net8.0]

This change doesn't seem to be reflected in the docs.

Expected behavior

The original code should still compile.

Actual behavior

Compiler error

Reproduction Steps

Make a project with Azure.Storage.Blobs 12.13.1 and the following code:

void Main()
{
	PageBlobClient client = new("", "", "");
	client.UploadPages(new MemoryStream(new byte[1]), offset: 0, conditions: new PageBlobRequestConditions());
}

This will compile without error.

Then, update to 12.19.1 => it will no longer compile.

Environment

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.8d38d0cc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.8d38d0cc
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

VS 17.8.2, also reproduces on the command line with dotnet build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions