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

sasToken does not work as documented #28322

Closed
carl-spread-ai opened this issue Jan 22, 2024 · 3 comments
Closed

sasToken does not work as documented #28322

carl-spread-ai opened this issue Jan 22, 2024 · 3 comments
Assignees
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-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@carl-spread-ai
Copy link

Type of issue

Code doesn't work

Description

I'm using a SAS Token to access the Blob Storage APIs. The examples mention just appending the token to the URL, sometimes with a ? delimiter, sometimes without it. Trying that out gave me a NoAuthenticationInformation error.

This didn't work:

const sasUrl = `https://${accountName}.blob.core.windows.net/${containerName}/${blobName}?${sasToken}`;
const client = new BlobServiceClient(sasUrl, null);

This did work:

const credential =new StorageSharedKeyCredential(accountName, sasToken);
const client = new BlockBlobClient(`https://${accountName}.blob.core.windows.net/${containerName}/${blobName}`, credential);

Page URL

https://learn.microsoft.com/en-us/javascript/api/overview/azure/storage-blob-readme?view=azure-node-latest&source=recommendations

Content source URL

https://github.com/MicrosoftDocs/azure-docs-sdk-node/blob/main/docs-ref-services/latest/storage-blob-readme.md

Document Version Independent Id

f3901614-6fa9-dc0e-928b-3698631cbde0

Article author

@azure-sdk

Metadata

  • ID: 9e6a0310-6551-e231-256b-a23e67add834
  • Service: storage
@github-actions github-actions bot added 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-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files) labels Jan 22, 2024
@xirzec xirzec removed the needs-team-triage Workflow: This issue needs the team to triage. label Jan 22, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jan 22, 2024
@EmmaZhu
Copy link
Member

EmmaZhu commented Feb 23, 2024

Hi @carl-spread-ai ,

SAS token is a bunch parameters specified in URL's query parameters which starts with a ?.

You may have use a tool which returns SAS token with ? as prefix.

Methods in Storage SDK returns SAS token without the ? prefix, then you'd need to add the ? by yourself when use it.

The document is consistent in Storage SDK's methods, but it's may not be the case when you use other tools.

@xirzec xirzec added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Feb 23, 2024
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 23, 2024
Copy link

Hi @carl-spread-ai. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

github-actions bot commented Mar 2, 2024

Hi @carl-spread-ai, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Mar 2, 2024
@EmmaZhu EmmaZhu closed this as completed Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
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-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants