Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate SAS URI from BlobContainerClient created through BlobServiceClient.GetBlobContainerClient #17626

Closed
mikamins opened this issue Dec 17, 2020 · 4 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@mikamins
Copy link

Describe the bug
A SAS URI cannot be generated from a BlobContainerClient obtained through BlobServiceClient.GetBlobContainerClient.

Expected behavior
If a BlobServiceClient is created from an account key connection string, I expect a BlobContainerClient obtained through BlobServiceClient.GetBlobContainerClient to be able to generate a SAS URI.

That is, I expect the following test to pass:

    [TestMethod]
    public void ContainerClientCanGenerateSasUri()
    {
        var connectionString = "UseDevelopmentStorage=true;";
        var serviceClient = new BlobServiceClient(connectionString);
        var containerClient = serviceClient.GetBlobContainerClient("test");

         // passes as expected
        Assert.IsTrue(serviceClient.CanGenerateAccountSasUri);

         // fails unexpectedly
        Assert.IsTrue(containerClient.CanGenerateSasUri);
    }

Actual behavior (include Exception or Stack Trace)
In the above example, containerClient.CanGenerateSasUri returns false.

To Reproduce

  1. Create a BlobServiceClient from an account key connection string
  2. Call GetBlobContainerClient on the service client
  3. CanGenerateSasUri returns false since the StorageSharedKeyCredential isn't passed to the container

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.7.0
  • Hosting platform or OS and .NET runtime version: Windows 10 .NET Framework 4.7.2
  • IDE and version : Visual Studio 16.3
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 17, 2020
@mikamins mikamins changed the title [BUG] Cannot generate SAS URI from client created through BlobServiceClient.GetBlobContainerClient [BUG] Cannot generate SAS URI from BlobContainerClient created through BlobServiceClient.GetBlobContainerClient Dec 17, 2020
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Dec 17, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 17, 2020
@ghost
Copy link

ghost commented Dec 17, 2020

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

Issue Details

Describe the bug
A SAS URI cannot be generated from a BlobContainerClient obtained through BlobServiceClient.GetBlobContainerClient.

Expected behavior
If a BlobServiceClient is created from an account key connection string, I expect a BlobContainerClient obtained through BlobServiceClient.GetBlobContainerClient to be able to generate a SAS URI.

That is, I expect the following test to pass:

    [TestMethod]
    public void ContainerClientCanGenerateSasUri()
    {
        var connectionString = "UseDevelopmentStorage=true;";
        var serviceClient = new BlobServiceClient(connectionString);
        var containerClient = serviceClient.GetBlobContainerClient("test");

         // passes as expected
        Assert.IsTrue(serviceClient.CanGenerateAccountSasUri);

         // fails unexpectedly
        Assert.IsTrue(containerClient.CanGenerateSasUri);
    }

Actual behavior (include Exception or Stack Trace)
In the above example, containerClient.CanGenerateSasUri returns false.

To Reproduce

  1. Create a BlobServiceClient from an account key connection string
  2. Call GetBlobContainerClient on the service client
  3. CanGenerateSasUri returns false since the StorageSharedKeyCredential isn't passed to the container

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.7.0
  • Hosting platform or OS and .NET runtime version: Windows 10 .NET Framework 4.7.2
  • IDE and version : Visual Studio 16.3
Author: mikamins
Assignees: -
Labels:

Client, Service Attention, Storage, customer-reported, needs-team-attention, needs-triage, question

Milestone: -

@jsquire
Copy link
Member

jsquire commented Dec 17, 2020

Thank you for your feedback. Tagging and routing to the team best able to assist.

@berendhaan
Copy link

Ran into the same issue today.

@seanmcc-msft
Copy link
Member

This bug was fixed in Azure.Storage.Blobs 12.8.0-beta.1:

-Sean

@seanmcc-msft seanmcc-msft changed the title [BUG] Cannot generate SAS URI from BlobContainerClient created through BlobServiceClient.GetBlobContainerClient Cannot generate SAS URI from BlobContainerClient created through BlobServiceClient.GetBlobContainerClient Dec 22, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants