简体   繁体   中英

Connect to Azure Batch service from browser jQuery ajax REST call

I have access to an Azure batch service with the account name and base64 authentication key. A coworker wrote a batch service that retrieves files, processes them, and returns them to a specified location. These files are stored in a SharePoint library, and the batch service works fine. What we would like to do, is from the browser, setup an ajax call in jQuery/ajax to properly create the correct headers and the proper authentication information to perform this request. I have found some documentation but no real examples that work because I primarily end up with an error:

The MAC signature found in the HTTP request is not the same as any computed signature.

It displays what it uses to create a key so I thought I would do that same thing but it still doesn't work and I get the same error.

Glad that Batch service part is working great.

WIth regards to the error message: "The MAC signature found in the HTTP request is not the same as any computed signature." Every request made against a storage service must be authenticated, In this case its related with the Authentication for Azure Storage.

Also, please take a look at the similar issue happened in past here:

Authentication for Azure Storage is not simply a matter of providing the access key (that is not very secure). You need to create a signature string that represents the given request, sign the string with the HMAC-SHA256 algorithm (using your storage key to sign), and encode the result in base 64. See https://msdn.microsoft.com/en-us/library/azure/dd179428.aspx for full details, including how to construct the signature string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM