I found you need to add host to headers and move the configuration from headers to authentication tab( key: authenication, value:{{header_authorization, Addto: header}}
What code is there in the "Tests" block in GET operation?? you only showed Headers and Pre-requestScript not showed Tests....!!! plz show that Tests one also
ok...I think this is the code in test block- var data = JSON.parse(responseBody); pm.environment.set("RowKey", data.value[0].RowKey); pm.environment.set("PartitionKey", data.value[0].PartitionKey); try it.
The authentication error you are observing is due to some other reason. Check your pre-request script is correct- const storageAccount = pm.environment.get('azure_storage_account'); const accountKey = pm.environment.get('azure_storage_key'); const date = new Date(); const UTCstring = date.toUTCString(); const dataToEncode = UTCstring + " " + `/${storageAccount}${pm.request.url.getPath()}`; const encodedData = unescape(encodeURIComponent(dataToEncode)); var hash = CryptoJS.HmacSHA256(encodedData, CryptoJS.enc.Base64.parse(accountKey)); var signature = hash.toString(CryptoJS.enc.Base64); var auth = "SharedKeyLite " + storageAccount + ":" + signature; pm.environment.set("header_authorization", auth); pm.environment.set("header_date", UTCstring);
Hi i am not able to create the signature...can you pleas help me......actually i need to call this from bot framework composer so can't write script like this in that . I am using Shared Key , what needs to be put in CanonicalizedResource basically pm.request.url.path} what should come here
pm.request.url.getPath() will have value depending on what operation you are performing. If you are creating table then it will be /Tables...if you are inserting record is already created table then it will be /...say, you created table by name testtable then it will be /testtable...hope that helps.
I followed the tutorial but Iam getting Status:403 Server failed to authorize the request. could you let me know What additonal permissions are required from storage side?
Sorry for late reply. Which authorization scheme you are trying - shared access key or shared access lite? shared access key scheme is little tricky if encoding format is not right then it will show problem.
great presentation, congrats
Thanks for the tutorial!!
Happy to help!
Excellent!
Glad you liked it!
Hi.. I want to fetch a particular entity based on partition key and row key . In that case, how can i form the signature?
can I do this even if the azure region is not on my current country. worried about the UTC date
Not sure...haven't tried that...you can try and let me also know whether it works or not.
I am trying to recreate the same scenario but getting the "ReferenceError: Crypto35 is not defined" error. Please help!
Can you share curl of access table by Access Keys ? I always get 403
I found you need to add host to headers and move the configuration from headers to authentication tab( key: authenication, value:{{header_authorization, Addto: header}}
What code is there in the "Tests" block in GET operation?? you only showed Headers and Pre-requestScript not showed Tests....!!! plz show that Tests one also
Sorry I lost the whole collection sometime back. Not sure what tests were there.
ok...I think this is the code in test block-
var data = JSON.parse(responseBody);
pm.environment.set("RowKey", data.value[0].RowKey);
pm.environment.set("PartitionKey", data.value[0].PartitionKey);
try it.
The authentication error you are observing is due to some other reason. Check your pre-request script is correct-
const storageAccount = pm.environment.get('azure_storage_account');
const accountKey = pm.environment.get('azure_storage_key');
const date = new Date();
const UTCstring = date.toUTCString();
const dataToEncode = UTCstring + "
" + `/${storageAccount}${pm.request.url.getPath()}`;
const encodedData = unescape(encodeURIComponent(dataToEncode));
var hash = CryptoJS.HmacSHA256(encodedData, CryptoJS.enc.Base64.parse(accountKey));
var signature = hash.toString(CryptoJS.enc.Base64);
var auth = "SharedKeyLite " + storageAccount + ":" + signature;
pm.environment.set("header_authorization", auth);
pm.environment.set("header_date", UTCstring);
@@raaviblog105 Thanks a lot,,.... Executed successfully🥳.....
Hi i am not able to create the signature...can you pleas help me......actually i need to call this from bot framework composer so can't write script like this in that . I am using Shared Key , what needs to be put in CanonicalizedResource basically pm.request.url.path} what should come here
pm.request.url.getPath() will have value depending on what operation you are performing. If you are creating table then it will be /Tables...if you are inserting record is already created table then it will be /...say, you created table by name testtable then it will be /testtable...hope that helps.
@@raaviblog105 thanks raavi so i am basically tried to query and insert and update the entities in table so in my case /... should suffice right?
Yes..thats right. If not working then share the exported collection...I will have a look at it.
I followed the tutorial but Iam getting Status:403 Server failed to authorize the request. could you let me know What additonal permissions are required from storage side?
Sorry for late reply. Which authorization scheme you are trying - shared access key or shared access lite? shared access key scheme is little tricky if encoding format is not right then it will show problem.