title: Error "BadRequest" when calling Azure Function in ADF
body: <p>I am creating an extensive data factory work flow that will create and fill a data warehouse for multiple customers automatic, however i'm running into an error. I am going to post the questions first, since the remaining info is a bit long. Keep in mind i'm new to data factory and JSON coding.</p>
  
  <p><strong>Questions &amp; comments</strong></p>
  
  <ul>
  <li>How do i correctly pass the parameter through to an Execute Pipeline activity?</li>
  <li>How do i add said parameter to an Azure Function activity?</li>
  </ul>
  
  <p>The issue may lie with correctly passing the parameter through, or it may lie in picking it up - i can't seem to determine which one. If you spot an error with the current setup, dont hesitate to let me know - all help is appreciated</p>
  
  <p><strong>The Error</strong></p>
  
  <pre><code>{
  "errorCode": "BadRequest",
  "message": "Operation on target FetchEntries failed: Call to provided Azure function
  '' failed with status-'BadRequest' and message -
  '{\"Message\":\"Please pass 'customerId' on the query string or in the request body\"}'.",
  "failureType": "UserError",
  "target": "ExecuteFullLoad"
  }
  </code></pre>
  
  <p><strong>The Setup:</strong></p>
  
  <p>The whole setup starts with a function call to get new customers from an online economic platform. It the writes them to a SQL table, from which they are processed and loaded into the final table, after which a new pipeline is executed. This process works perfectly. From there the following pipeline is executed:</p>
  
  <p><a href="https://i.stack.imgur.com/pTqo4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pTqo4.png" alt="enter image description here"></a></p>
  
  <p>As you can see it all works well until the ForEach loop tries to execute another pipeline, that contains an azure function that calls a .NET scripted function that fills said warehouse (complex i know). This azure function needs a customerid to retrieve tokens and load the data into the warehouse. I'm trying to pass those tokens from the InternalCustomerID lookup through the ForEach into the pipeline and into the function. The ForEach works actually,  but fails <em>"Because an inner activity failed"</em>.</p>
  
  <p>The Execute Pipeline task contains the following settings, where i'm trying to pass the parameter through which comes from the foreach loop. This part of the process also works, since it executes twice (as it should in this test phase): <a href="https://i.stack.imgur.com/4cLwR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4cLwR.png" alt="enter image description here"></a></p>
  
  <p>I dont know if it doesn't successfully pass the parameter through or it fails at adding it to the body of the azure function.</p>
  
  <p>The child pipeline (FullLoad) contains the following parameters. I'm not sure if i should set a default value to be overwritten or how that actually works. The guides i've look at on the internet havent had a default value.
  <a href="https://i.stack.imgur.com/iAs0v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAs0v.png" alt="enter image description here"></a></p>
  
  <p>Finally there is the settings for the Azure function. I'm not sure what i need to write in order to correctly capture the parameter and/or what to fill in - if it's the header or the body regarding the error message. I know a post cannot be executed without a body.<br>
   <a href="https://i.stack.imgur.com/pa3Vt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pa3Vt.png" alt="enter image description here"></a></p>
  
  <p>If i run this specific funtion by hand (using the Function App part of portal.azure.com) it works fine, by using the following settings:</p>
  
  <p><a href="https://i.stack.imgur.com/Cz1Mo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cz1Mo.png" alt="enter image description here"></a></p>