I'm trying to list the table names present in the azure storage account that is enabled with public access using the postman but i'm getting the authentication failed error:
Error:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>AuthenticationFailed</code>
<message xml:lang="en-US">Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId: alphanumeric id
Time:2024-04-23T12:32:52.6326261Z</message>
</error>
URL: https://srcstoreacc131.table.core.windows.net/Tables?SASToken
Method: GET
How are you creating the SAS token? Please edit your question and include that. – Gaurav Mantri
In the Storage Account > SAS Menu > Selecting Table and permissions as list and then generating the SAS URL/tokens.
The error occurs if you are not passing valid SAS token while calling the API. Initially, I too got same error when I ran the API with extra space after sig
like this:
GET https://storageaccname.table.core.windows.net/Tables?SASToken
Response:
To resolve the error, generate the SAS token with correct permissions and include it properly with valid signature while calling API.
In my case, I generated SAS token by selecting below permissions:
When I called the REST API again with valid SAS token by removing extra space at the end, I got the response successfully with list of tables like this:
GET https://storageaccname.table.core.windows.net/Tables?SASToken
Response: