Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.93k stars 441 forks source link

Cannot have [FunctionName] starting with 'admin' #7634

Closed seangwright closed 3 years ago

seangwright commented 6 years ago

OS: Win 10 x64 VS: 2017 15.4.4 Professional Packages:

<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.1.0-beta4" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.1.0-beta4" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="1.0.0-beta4" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.1.0-beta4" />
<PackageReference Include="Mustachio" Version="1.1.26" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.6" />
<PackageReference Include="Sendgrid" Version="9.9.0" />
<PackageReference Include="WindowsAzure.Storage" Version="8.6.0" />

If I prefix a [FunctionName] attribute with admin the sdk reports an error in the console and will not expose the function.

Example

[FunctionName("admin-results-email")]
public static async Task<HttpResponseMessage> RunAdminResultsEmail([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)]HttpRequestMessage req, TraceWriter log, ExecutionContext context)
[11/15/2017 5:25:16 PM] Job host started
[11/15/2017 5:25:16 PM] The following 1 functions are in error:
[11/15/2017 5:25:16 PM] admin-results-email: The specified route conflicts with one or more built in routes.

Whereas [FunctionName("results-email-admin")] works fine.

Either this shouldn't actually conflict with a built in route or the documentation should be updated indicating you can't use the above pattern for function names.

ahmelsayed commented 6 years ago

@fabiocav @mathewc is it indeed by design that you can't have a function starting with admin or is this something that can be fixed?

fabiocav commented 6 years ago

The restriction is on the function route, and in this case, since the route is not set (it's set to null), the function name becomes the route, which is invalid

grahamehorner commented 5 years ago

any update on this?

ColbyTresness commented 5 years ago

still relevant @fabiocav @ahmelsayed ?

jaxnz commented 3 years ago

This is still relevant, and should at least be mentioned on the documentation. I spent hours trying to find out why I was getting 404 responses.

Proletter commented 3 years ago

This issues still exists and it is really annoying. Why am I being prevented from creating a function that starts with "admin" in a function app? This should at least be in the documentation.

ahmelsayed commented 3 years ago

I'm moving the issue to https://github.com/Azure/azure-functions-host/ since the limitation comes from there.

v-bbalaiagar commented 3 years ago

Closing this issue as document issue is opened. Please provide your inputs here - https://github.com/MicrosoftDocs/azure-docs/issues/80267