I am writing some code (dotnet C#) to interface with the Azure storage API. I have successfully managed to get the Create Table functionality working with help from this post.
I am now trying to query the existence of a single table as highlighted in the Microsoft docs:
Here are my authorization signature and my http request:
**Signature:**
GET\n
\n
application/json\n
Thu, 08 Dec 2022 11:23:19 GMT\n
/MyStorageAccountName/Tables\n
/MyStorageAccountName/MyTableName\n
>Request Message:
Method:
GET,
RequestUri:
'https://MyStorageAccountName.table.core.windows.net/Tables('MyTableName')',
Version:
1.1,
Content:
<null>,
Headers:
x-ms-date: Thu, 08 Dec 2022 11:23:19 GMT
Accept: application/json; odata=nometadata
x-ms-version: 2015-04-05
Accept-Charset: UTF-8
MaxDataServiceVersion: 3.0;NetFx
DataServiceVersion: 1.0;NetFx
Authorization: SharedKey MyStorageAccountName:XXXgzOBdHA65fVYYYa5pkjgxeayB/bSxZZZbwo=
------------------------------------------------------------------------------------------------
However no matter what I try I always receive the following response:
StatusCode: Forbidden Error: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
I have followed the Microsoft docs instruction on how to formulate the auth signature: Table service (shared key authorization)
I have noted from other posts that the Content-MDS is optional but if included it must also be included in the content header:
//request.Content.Headers.ContentMD5 = Convert.FromBase64String(CreateMD5(payload));
As this is a GET request and I have no content I have left out the MD5 in the auth signature and just added a \n newline.
I have search for many hours and try tweaking the auth signature but the error remains the same.
Any advice would be very much appreciated as although the error is telling me that there is an issue with my authentication signature it is not giving me an indication of why and as far as I can see it looks correct. Thanks in advance to all contributors.