title: Azure Logic Apps - generated HMAC-SHA256 method signature
body: <p>I'm looking to build a Logic App workflow to connect to a REST API to GET a list of Products (retuned as JSON) from the Unleashed API ( <a href="https://apidocs.unleashedsoftware.com/AuthenticationHelp" rel="nofollow noreferrer">https://apidocs.unleashedsoftware.com/AuthenticationHelp</a> ).</p>
  <p>I've prototyped the GET request in postmaan successfully generated the required HMAC-SHA256 encrypted method signature in the pre-request script. Now I need to find a way to do the same thing in my Logic Apps workflow.</p>
  <p>Having figured out that the Logic Apps Inline Code component wouldn't give me anything but basic Javascript (no access to crypto functions), I thought of writing an Azure Function in node.js - node.js chosen primarily in order to be able to reuse my pre-request script code. Unfortunately, I'm getting absolutely nowhere with this - vertical learning curve doesn't quite cover it!</p>
  <p>For one thing, isn't there some kind of inline trigger to allow me to access the function rather than having to send a HTTP request? And how do I populate the output bindings to get the hash value back?</p>
  <p>My pre-request script is as follows</p>
  <pre><code>var urlParam = &quot;modifiedSince2021-04-01&quot;;
  var url = &quot;https://api.unleashedsoftware.com/&quot; + &quot;Products?&quot; + urlParam;
  var hash = CryptoJS.HmacSHA256(urlParam, 'Customer API-KEY here');
  var hash64 = CryptoJS.enc.Base64.stringify(hash);
  
  pm.environment.set(&quot;BaseURI&quot;, url);
  pm.environment.set(&quot;hmacKey&quot;, hash64);
  </code></pre>
  <p>Any help with constructing my node.js, or any other suggestions for turning this into a solution in Azure would be greatly appreciated.</p>