I\'ve spent the past 24 hours reading all about how to create Azure Functions and have successfully converted a MVC WebApi over to a new Function App with multiple functions
I've created a small extension to Azure Functions v2, that might help you when used with Bearer Tokens.
For instance, to work with Azure B2C, when you want to allow anonymous requests to the app.
So you can obtain your ClaimsPrincipal right in the Azure Function without any boilerplate used.
[FunctionName("Example")]
public async Task Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
[FunctionToken] FunctionTokenResult token,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return (ActionResult) new OkObjectResult($"Hello, {token}");
}
Code is posted to Github