I need some help identifying why an Azure Function deployed to a Linux consumption plan is unable to start and complaining about the AspNetCore.App runtime not being available:
What I don't quite understand is why would this be referencing RC2 at all. We've isolated the problem to a package dependency (StackExchange.Redis.Extensions.AspNetCore" Version="7.2.1") - if we include this, it breaks the function as deployed in Azure.
Looking at the source for that dependency, it appears that all they're doing is referencing the AspNetCore.App framework reference like so:
Note that our Azure Function is able to run .Net 5 with the same project reference (6.x version of the same lib) without any issues.
We're using the CLI to create and deploy the function like so:
Build:
- task: UseDotNet@2
inputs:
version: $(dotNetVersion)
displayName: Set DotNet Version $(dotNetVersion)
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/xyz.Function.OurFunction.csproj'
arguments: '--configuration $(buildConfiguration) --output $(System.DefaultWorkingDirectory)/func_api'
displayName: 'Build Function'
Function app creation:
az functionapp create --name $(functionAppName)
--resource-group $(rg) --consumption-plan-location $(region)
--functions-version 4 --os-type Linux --runtime dotnet-isolated
--storage-account $(funstorageAccountName) --assign-identity '[system]'
Deployment:
- task: AzureFunctionApp@1
inputs:
azureSubscription: '$(azureSubscription)'
appType: 'functionAppLinux'
appName: '$(functionAppName)'
package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
deploymentMethod: 'zipDeploy'
runtimeStack: 'DOTNET-ISOLATED|6.0'
appSettings: >-
-FUNCTIONS_WORKER_RUNTIME dotnet-isolated

