Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.66k forks source link

[QUERY] BlockBlobClient after initialized with SAS, can it be changed to use TokenCrendential #46263

Open johnemmanuelm opened 4 days ago

johnemmanuelm commented 4 days ago

Library name and version

Azure Storage Blobs 12.19.1

Query/Question

As part of requests coming into our system, SAS blob url is received along with other query parameters. We're working to move away from using blob url with SAS to using TokenCrendential. Until SAS is removed by the incoming requests, we want to be able to use blob sas url to create BlockBlobClient and transform the instance to switch to use TokenCrendential.

When using the BlockBlobClient constructor that takes TokenCrendential, passing the Sas url results in error "Authentication information is not given in the correct format. Check the value of Authorization header."

What we're looking for a way to be able to use the SAS blob url and have to use token credential. One option is to strip off the SAS as part of the blob url with other query params - however would like to not have custom code to do it instead some standard of achieving this would be good.

Environment

C# Azure SDK

github-actions[bot] commented 4 days ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.