Azure / azure-webjobs-sdk-extensions

Azure WebJobs SDK Extensions
MIT License
342 stars 206 forks source link

Are Http Trigger Functions Custom Handlers or part of the Function Host? #751

Open dotnetcadet opened 2 years ago

dotnetcadet commented 2 years ago

I'm currently working on an open source project to make custom Http Triggers handle OData request for any repository (currently targeting Cosmos DB and SQL Server for CQRS).

I've been trying to make custom Http Triggers but I am having a hard time figuring out how routing is implemented for Http Triggers.

After going though the source code it seems like these particular triggers (HttpTriggers) are part if the main host rather than being a custom handler which http requests are sent to.

Is this the case? And if so is there anyway to configure custom routing on the main host rather than be a custom handler?

v-bbalaiagar commented 2 years ago

Hi @dotnetcadet, Thank you for your feedback! We will check for the possibilities internally and update you with the findings. Meanwhile, here is a blog post which addresses similar scenario where the blog talks about detailed view on Azure Function Custom Handlers - https://www.serverless360.com/blog/azure-function-custom-handlers

Please check and let us know if this helps.

dotnetcadet commented 2 years ago

@v-bbalaiagar Thank you for this article.

Fortunately, I'm already aware of how custom handlers work and how to create them. I guess what I'm more interested in is how routing works when it comes to HttpTrigger functions. After reviewing the source code in the function host repository, it appears you can't do custom routing. Http Route Manager

The main issue I am running into is the underlined API request to invoke the actual function. I would like to configure custom routing like HttpTriggers do, so I can call the route without a query parameter. Is this possible at the moment? image

v-bbalaiagar commented 2 years ago

Can you explain the scenario and the requirement so that we can investigate further.

dotnetcadet commented 2 years ago

@v-bbalaiagar ,

All I need to know is: Can you configure custom routing on the main host from a function extension?