question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue when generating a url using sas token. Method file_service.make_file_url()

See original GitHub issue

Which service(blob, file, queue) does this issue concern?

File share

Which version of the SDK was used? Please provide the output of pip freeze.

azure-storage-file==2.0.1 azure-storage-common==2.0.0 sdk-version

What problem was encountered?

https://github.com/Azure/azure-storage-python/blob/b8c5c9a1bc73065fd015c0fec75617cef263c6ee/azure-storage-file/azure/storage/file/fileservice.py#L233

When genrating a url using the method make_file_url passing a sas token, the generated url has two query strings (‘?’) instead of one. generated_url

The SaS Token generated on Azure portal starts with a query string. SaSToken-Azure

Have you found a mitigation/solution?

Yes. Remove the query string (‘?’) at line 233.

Note: for table service, please post the issue here instead: https://github.com/Azure/azure-cosmosdb-python.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xiafu-msftcommented, Jun 19, 2019

Hi @GeisaFaustino Thanks for catching this bug. You are totally right that ideally the method make_file_url should work with both SAS token and the SAS token generated the API. This pull request https://github.com/Azure/azure-storage-python/pull/611 is to fix that.

1reaction
zezha-msftcommented, Jun 18, 2019

@xiafu-msft we should make a fix, where we check whether the sas token starts with a ‘?’; if not, add a ‘?’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grant limited access to Azure Storage resources using shared ...
The SAS token is not tracked by Azure Storage in any way. You can create an unlimited number of SAS tokens on the...
Read more >
How to Create a Azure Blob Shared Access Signature (SAS ...
The script below will create an Azure Blob SAS Token with the Azure ... base URL, the DDP_RESOURCE_URL is appended to the base...
Read more >
Problem Generating Azure ADLS Gen2 SAS Token for ...
I believe the issue is that you are using AccountSasPermissions instead of ContainerSasPermissions . Can you try by changing the following ...
Read more >
Storage Account SAS Tokens, Access Keys, And Connection ...
Which SAS Type To Use? Account SAS Token. Parameters Of listAccountSas Function; Generating an Account SAS Token In Azure Bicep. Service SAS ...
Read more >
Avoiding "AuthorizationFailed" error when hand-crafting ...
The way you create a SAS Token is that you create a StringToSign and sign this with your account key to get a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found