I'm currently trying to access files & directories on an Azure Storage Account Fileshare (let's call it rootdirectory ) from a Dynamics Business Central page action.
The method to access files stored in it is to build and send an HTTP GET request (with a client) to https://myaccount.file.core.windows.net/myfileshare/rootdirectory to retrieve a filelist.
I'm trying to use a Shared Access Signature to authenticate the request.
The blocking point that I can't get through is the following error message :
Authentication information is not given in the correct format. Check the value of Authorization header.
I'm setting my request headers like this :
client.DefaultRequestHeaders().Clear();
client.DefaultRequestHeaders().Add('x-msdate', '2019-02-20');
client.DefaultRequestHeaders().Add('Authorization', '...');
My main problem is that I can't seem to find the proper format (to use in the '...' part) asked in the error message in any tutorial.
I've tried the following formats (and minor variations inside it)
'SharedAccessSignature myaccount:signature'
'SharedAccessSignature sv=2018-03-28&ss=f&srt=sco&sp=rwdlc&se=2019-02-20T18:12:27Z&st=2019-02-20T10:12:27Z&spr=https&sig=signature'
'SharedAccessSignature sr=https%3A%2F%2Fmyaccount.file.core.windows.net%2Fmyfileshare%2Frootdirectory&sig=signature&se=2019-02-21T22:36:05Z&skn=key1'
I also tried putting it in the service URI, nothing better.
Has anyone already encountered this issue ?
Any help would be appreciated.
Thanks for your time.