Context
I have developed an azure function app with an http triggered azure function. It is written in C#, targetting .Net 6. I have deployed the function app to a linux function app on a consumption plan using a bicep template.
Problem
The Azure Portal does not show the function:

and the streaming log shows this:

Code
The function looks like this:
using System.Net;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;
namespace FunctionApp
{
public static class Function
{
[Function("MyFunction")]
public static HttpResponseData Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequestData req,
FunctionContext executionContext)
{
var logger = executionContext.GetLogger(nameof(Function));
logger.LogInformation("C# HTTP trigger function processed a request.");
var response = req.CreateResponse(HttpStatusCode.OK);
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
response.WriteString("Hello World!");
return response;
}
}
}
The relevant part of the bicep template looks like this:
resource myFunctionApp 'Microsoft.Web/sites@2022-09-01' = {
name: 'expechofunctionapp'
location: location
kind: 'functionapp,linux'
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: myAppPlan.id
httpsOnly: true
reserved: true
siteConfig: {
linuxFxVersion: 'DOTNET-ISOLATED|6.0'
appSettings: [
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${myFunctionStorage.name};EndpointSuffix=${az.environment().suffixes.storage};AccountKey=${myFunctionStorage.listKeys().keys[0].value}'
}
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~4'
}
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
value: myAppInsights.properties.InstrumentationKey
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'dotnet-isolated'
}
{
name: 'dotnetenv'
value: environment
}
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '${myFunctionStorage.properties.primaryEndpoints.blob}azurefunction/FunctionApp_Binaries.zip'
}
]
}
}
}
Steps taken