I have an Azure Function with 3 endpoints:
- Analyze: /{tenantName}/Analyze
- Search: /{tenantName}/Search
- GetImage: /{tenantName}/{renditionString?}
When I call the "Search" endpoint, then it hits the "anything" route (number 3) while I would expect it to first hit the static routes and only if they are not matched, then it would hit the route with the wildcard.
When I call the "Analyze" endpoint then it works as expected. Here is a screenshot showing my test.
What exactly determines which endpoint is hit in the route? How do I troubleshoot this?
(I tried many things to confirm the issue, such as removing query parameters and renaming endpoints to something obscure)
Edit
The solution by @hury-shen worked - by changing the method name the alphabetically sorted matching changed and actually affected which path was hit. I am describing it here in addition to his fully satisfactory answer, so I can include a screenshot showing how it looks when solved.


