azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Cannot have [FunctionName] starting with 'admin'

Open v-bbalaiagar opened this issue 3 years ago • 3 comments

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.

Related issue https://github.com/Azure/azure-functions-host/issues/7634


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

v-bbalaiagar avatar Aug 27 '21 12:08 v-bbalaiagar

@v-bbalaiagar Thank you for sharing this. Could you please share the documentation you were following if any ??

shashishailaj avatar Aug 27 '21 13:08 shashishailaj

@ggailey777 I've update this issue to address the trigger reference doc but do let me know if there is a different doc that you think should have this limitation listed.

PramodValavala-MSFT avatar Aug 30 '21 06:08 PramodValavala-MSFT

There's an underlying issue open in the host repo: https://github.com/Azure/azure-functions-host/issues/1781 It would be nice if they fix it, but if not we should document it.

ggailey777 avatar Oct 17 '22 16:10 ggailey777

This issue took me 3 whole days digging too much inside Azure Portal and cracking my head and yet didn't have any clue until finally I reached this page. And from what I understand here, this hasn't been addressed, am I correct to say that?

arkarwmh avatar Mar 16 '23 05:03 arkarwmh