Azure / Azure/AzureStor

Generate SAS tokens with get_service_sas or get_account_sas

Open
#140 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
R
Stars
68
Forks
27
Avg merge
2d 7h
Merged PRs (30d)
1

Description

I'm trying to generate SAS tokens using the two functions mentioned above. Using example code in the docs (below) a SAS token is generated, however when I append this to the end of the blob I want to access I get an error stating the signature did not match.

I generate the SAS as follows:

`endp <- storage_endpoint(Sys.getenv("LONDON_BUS_STORAGE_ENDPOINT"), key=Sys.getenv("LONDON_BUS_STORAGE_KEY"))`

`sas <- get_service_sas(endp, resource = Sys.getenv("LONDON_BUS_ANNOTATE_CONTAINER_NAME"), permissions="r")`

`
blob_file_url_with_sas <- paste0(Sys.getenv("LONDON_BUS_STORAGE_ENDPOINT"), "/", Sys.getenv("LONDON_BUS_ANNOTATE_CONTAINER_NAME"), "/", Sys.getenv("LONDON_BUS_ANNOTATE_FILE"), sas)
`

Where the environmental variables relate to the storage account, storage account key, container name, and the name of the blob.

The error is:

`

AuthenticationFailed
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:2b7236bd-301e-004c-2d6b-757ef4000000 Time:2024-03-13T17:22:19.7678924Z
Signature did not match. String to sign used was r 2024-03-13T17:07:02Z 2024-03-14T01:07:02Z /blob/{{MY_STORAGE_ACCOUNT}}/{{MY_CONTAINER}} 2021-06-08 c

`

When I generate a SAS token in the GUI in my Azure account everything works. I'm only trying to generate with AzureStor so that I can generate frequently for extra security.

Any help on this is much appreciated. I've tried numerous variations of the SAS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.