title: Azure functions: how to bind query string parameters of http trigger function to SQL query of Cosmos DB
body: <p>I am trying to run an http trigger Azure function with Cosmos DB input binding. I would like the url of the http trigger to include several parameters on the query string that become bound to the SQL query of the input Cosmos DB binding. I am trying the following bindings in <code>function.json</code>, but it does not work (the function does not even get triggered):</p>
  
  <pre><code>{
    "direction": "in",
    "type": "httpTrigger",
    "authLevel": "anonymous",
    "name": "req",
    "methods": [ "get" ],
    "route": "users/{age=age?}/{gender=gender?}"
  },
  {
    "direction": "in",
    "type": "documentDB",
    "name": "users",
    "databaseName": "Database",
    "collectionName": "Users",
    "sqlQuery": "SELECT * FROM x where x.age = {age} and x.gender = {gender}",
    "connection": "COSMOSDB_CONNECTION_STRING"
  },
  </code></pre>
  
  <p>According to this <a href="https://stackoverflow.com/a/33505365/5689927">answer</a> the route constraint <code>users/{age=age?}/{gender=gender?}</code> is valid for Web API, and according to the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook#url" rel="noreferrer">documentation</a> <em>you can use any Web API Route Constraint with your parameters</em>. Ultimately I would to like make a GET request to the Azure function that looks like <code>api/users?age=30&amp;gender=male</code>. How should this be done then?</p>