title: How to configure customer-specific API keys for Azure Functions
body: <p>I want to create a C# Azure Function with http trigger. I want to secure it with an <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook#working-with-keys" rel="noreferrer">API Key</a>, provide a separate key per customer, and the function should provide customer-specific data so needs to identify who is calling it.</p>
  
  <p>Can I use Azure Function API Keys to identify the customer, e.g. get the name of the Key that has been passed? Or is there no way of knowing within the azure function which key was used to authenticate the request? </p>
  
  <p>If there were a method like <code>GetApiKeyName()</code> I could check the key name against a list of customers in my database and return different data based on who is calling the function. e.g. imagine I have a sales-tracking system and my function is <code>/api/GetMonthlySales</code>. If customer 1 calls the function with their API key they should get their monthly sales and if customer 2 calls it they'd get a different amount.</p>
  
  <p>If this isn't possible that means I need to give additional authentication data to each customer for them to pass to each function call, e.g. a customer Id and a secret Key. But this defeats the purpose of using Azure Functions API Keys, right?</p>
  
  <p>A similar scenario would be if I want to charge customers when they call my function. How do I identify which customer is calling my function?</p>