I dont know how to describe this as a Google search so here it goes..
I have an Azure function with some methods:
-
POST /123456 -> creates the relation with number 123456 by using the information in the body.
-
POST / -> creates the relation with a random number by using the information in the body.
Both are handled like this:
[Function("RegisterRelation")]
public async Task<HttpResponseData> RunAsync(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "registerrelation/{relationnumber?}")]
and have a URL Rewrite policy in the API Management Portal:
<rewrite-uri template="/registerrelation/{id}" />
Now I want to have this method as well:
- POST /search-> Searches information for a relation by arguments that are specified in the body.
[Function("Searching")]
public async Task<HttpResponseData> RunAsync(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "search")]
I notice that when I run the latter, the first method is executed, (so a relation with number ‘search’ is created. I believe it is because of the alphabetic order. In .Net6 I was able to fix this with an underscore in the functionname, but .Net8 doesn’t accept this anymore..
I will probably make a mistake in the API definition here but I have no clue.