I have an Azure Function and I want to set a custom HTTP endpoint. Following the answer to this SO question, I ended up with something like this:
[FunctionName("DoSomething")]
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "v1/tenants/{tenantId}/locations/{locationId}/products?manufacturer={manufacturer}")]
HttpRequest request, ILogger logger, string tenantId, string locationId, string manufacturer)
{
//
}
However, the route is not accepted by the Webjob:
"v1/tenants/{tenantId}/locations/{locationId}/products?manufacturer={manufacturer}"
The reason is because of the question mark '?':
An error occurred while creating the route with name 'DoSomething' and template 'api/v1/tenants/{tenantId}/locations/{locationId}/products?manufacturer={manufacturer}'. The literal section 'products?manufacturer=' is invalid. Literal sections cannot contain the '?' character. Parameter name: routeTemplate The literal section 'products?manufacturer=' is invalid. Literal sections cannot contain the '?' character.
Question
How can I specify a query parameter in a custom HTTP endpoint of my Azure Function?