Skip to content

[QUERY] Storage: How can I create a SAS Uri for an earlier API version? #51354

@wecha-ms-v2

Description

@wecha-ms-v2

Library name and version

Azure.Storage.Blob 12.24.0

Query/Question

I am writing code to create a blob storage container and generate a blobsasuri pointing to it

I target AzureStack Hub storage service. [1]. I am aware the platform is not compatible with the latest api-version so I set a compatible api version [2].

When updating to a newer blob SDK(12.24.0), I noticed the generated blobsasuri [3] is no long valid. [4]. I have not changed anything aside from bumping up the version.

Looking at the error message From comparing previous blobSasuri [3], I suspect the problem is the security version sv=2025-05-05 is not supported in AzureStackHub since the only change I did was to update the SDK

If sv is indeed the problem, is there a way to set the sv version? I poked around the code but it didn't seem related to the api-version I set [2]

[1]
https://learn.microsoft.com/en-us/azure-stack/user/azure-stack-acs-differences?view=azs-2501

[2]
this.blobServiceClient = new BlobServiceClient(
this.azureStorageOptions.BlobStorageAccountConnectionString,
new BlobClientOptions(ServiceVersion.V2021_08_06));

[3]
$BlobSasUri = 'https://[blobcontainerendpoint]/988b756a-1e62-4c8d-a0b1-297e3824ad4c?sv=2025-05-05&se=2025-07-21T15%3A34%3A52Z&sr=c&sp=rl&sig=[xxxx]'

[4]
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:2e4584a4-3e00-04b6-4290-a9b9e63bd320
Time:2025-07-18T16:11:06.7337976Zsv is either not in the correct format or is not equal or later than version 2012-02-12sv is either not in the correct format or is no t equal or later than version 2012-02-12Microsoft.Cis.Services.Nephos.Common.Authentication.Authenticat
ionFailureException: sv is either not in the correct format or is not equal or later than version 2012-02-12

Environment

No response

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