How to get Route template in Azure Functions isolated

Viewed 23

I'd like to retrieve the route template of a particular HTTP triggered Azure Function on runtime, i.e. the value of Route parameter of HttpTrigger:

[Function(FunctionNames.GetInfoDefinition)]
public async Task<HttpResponseData> GetPerson([HttpTrigger(AuthorizationLevel.Function, nameof(HttpMethod.Get), Route = $"{Version}/{PersonsRoute}/{{{PersonId}}}")]
    HttpRequestData req, FunctionContext executionContext, string personId)
{
    ...
}

How can I retrieve it? Ideally without the need to use reflection.

0 Answers
Related