I have a problem with passing class object as an input parameter to azure function, what is the proper way of doing it? I have function like posted below.
public async Task<IActionResult> GetClinics(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "clinics")] HttpRequest req, ILogger log, PersonDocument thePerson)
{
//do something
}
Error that i got:
The 'GetClinics' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'GetClinics'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'thePerson' to type PersonDocument. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
what is the simplest way to solve it? Do i have to prepare my own custom binding? PersonDocument is just a class with some properties that i would like to extract from body. The only information that i found show how to add custom binding with custom attribute, but I am curious if it is really required to add them to solve such an easy problem?