Azure / Azure/azure-functions-host

Http Trigger Fails to Start With net8.0-windows + Azure.Identity

Open
#10,084 2 comments 0 reactions 0 assignees View on GitHub
Needs: Attention :wave:
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### Check for a solution in the Azure portal
For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select `Diagnose and solve problems` from the left, and view relevant dashboards before opening your issue.

When targeting net8.0-windows and the Azure.Identity package is installed (though not directly referenced), my http trigger fails to load. If I change the target to net8.0, it works. OR, if I remove the Azure.Identity package, it works. But with both of those it fails. Also, when I run it locally, it _works_. I wasn't sure if I should post this here or on the azure sdk repo, but since it works locally but not when deployed, I figured I would start here. I created a basic repo to reproduce the issue - see below for details.

#### Investigative information

These are from the test function I created to reproduce the problem:

- Timestamp: 2024-04-30T18:39:46.389 (issue is ongoing)
- Function App version: 4.33.1.22394
- Function App name: function-start-failure
- Function name(s) (as appropriate): Function1
- Invocation ID: (Function is unable to load)
- Region: Central US

#### Repro steps

1. Create new "isolated worker" net8.0-windows function app
2. Add an http trigger
3. Add Azure.Identity package
4. Deploy it (it works locally)

#### Expected behavior

Http trigger loads.

#### Actual behavior

Http trigger fails to load.

#### Known workarounds

Avoid using Azure.Identity. Change to net8.0 (not an option for me but does fix it)

#### Related information

Here is an example repo that reproduces the issue: https://github.com/Anchora-Solutions/FunctionStartFailure

And that is deployed to https://function-start-failure.azurewebsites.net

Also, here are the logs I've found for host startup:

```
2024-04-30T18:39:46.389 [Information] Loading functions metadata
2024-04-30T18:39:46.390 [Information] Reading functions metadata (Custom)
2024-04-30T18:39:46.390 [Information] 1 functions found (Custom)
2024-04-30T18:39:46.390 [Information] 0 functions loaded
2024-04-30T18:39:46.392 [Information] Loading functions metadata
2024-04-30T18:39:46.392 [Information] Reading functions metadata (Custom)
2024-04-30T18:39:46.392 [Information] 1 functions found (Custom)
2024-04-30T18:39:46.392 [Information] 0 functions loaded
2024-04-30T18:39:47.417 [Information] Host Status: {
"id": "function-start-failure",
"state": "Running",
"version": "4.33.1.22394",
"versionDetails": "4.33.1+3a214f2665e01b267f01f6d5c7cc49f79c118642",
"platformVersion": "101.1.7.100",
"instanceId": "740fb47444741eb75df61a3f5042f4e1a8060d95298481fd10bc70cd5cd988de",
"computerName": "10-30-5-3",
"processUptime": 123263,
"functionAppContentEditingState": "Unknown",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "4.16.0"
}
}
2024-04-30T18:39:47.460 [Information] Host Status: {
"id": "function-start-failure",
"state": "Running",
"version": "4.33.1.22394",
"versionDetails": "4.33.1+3a214f2665e01b267f01f6d5c7cc49f79c118642",
"platformVersion": "101.1.7.100",
"instanceId": "740fb47444741eb75df61a3f5042f4e1a8060d95298481fd10bc70cd5cd988de",
"computerName": "10-30-5-3",
"processUptime": 123305,
"functionAppContentEditingState": "Unknown",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "4.16.0"
}
}
2024-04-30T18:39:51.380 [Information] Host lock lease acquired by instance ID '740fb47444741eb75df61a3f5042f4e1'.
2024-04-30T18:40:16.259 [Information] Loading functions metadata
2024-04-30T18:40:16.291 [Information] Reading functions metadata (Custom)
2024-04-30T18:40:16.292 [Information] 1 functions found (Custom)
2024-04-30T18:40:16.292 [Information] 0 functions loaded
2024-04-30T18:40:16.292 [Information] Loading functions metadata
2024-04-30T18:40:16.292 [Information] Reading functions metadata (Custom)
2024-04-30T18:40:16.292 [Information] 1 functions found (Custom)
2024-04-30T18:40:16.292 [Information] 0 functions loaded
2024-04-30T18:41:35.347 [Information] File change of type 'Created' detected for 'C:\home\site\wwwroot\app_offline.htm'
2024-04-30T18:41:35.347 [Information] Host configuration has changed. Signaling shutdown
2024-04-30T18:41:35.347 [Information] File change of type 'Created' detected for 'C:\home\site\wwwroot\app_offline.htm'
2024-04-30T18:41:35.348 [Information] Host configuration has changed. Signaling restart
2024-04-30T18:41:35.428 [Information] Stopping JobHost
2024-04-30T18:41:35.428 [Information] Job host stopped
2024-04-30T18:43:32.648 [Information] Reading functions metadata (Custom)
2024-04-30T18:43:32.656 [Information] 1 functions found (Custom)
2024-04-30T18:43:32.662 [Information] 0 functions loaded
2024-04-30T18:43:32.666 [Information] You must install or update .NET to run this application.
2024-04-30T18:43:32.666 [Error] App: C:\home\site\wwwroot\FunctionStartFailure.dll
2024-04-30T18:43:32.666 [Information] Architecture: x64
2024-04-30T18:43:32.666 [Information] Framework: 'Microsoft.WindowsDesktop.App', version '8.0.0' (x64)
2024-04-30T18:43:32.666 [Information] .NET location: C:\Program Files\dotnet\
2024-04-30T18:43:32.666 [Information] No frameworks were found.
2024-04-30T18:43:32.666 [Information] Learn more:
2024-04-30T18:43:32.666 [Error] https://aka.ms/dotnet/app-launch-failed
2024-04-30T18:43:32.666 [Information] To install missing framework, download:
2024-04-30T18:43:32.666 [Information] https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
2024-04-30T18:43:32.668 [Information] ApplicationInsightsLoggerOptions
{
"SamplingSettings": {
"EvaluationInterval": "00:00:15",
"InitialSamplingPercentage": 100.0,
"MaxSamplingPercentage": 100.0,
"MaxTelemetryItemsPerSecond": 20.0,
"MinSamplingPercentage": 0.1,
"MovingAverageRatio": 0.25,
"SamplingPercentageDecreaseTimeout": "00:02:00",
"SamplingPercentageIncreaseTimeout": "00:15:00"
},
"SamplingExcludedTypes": "Request",
"SamplingIncludedTypes": null,
"SnapshotConfiguration": null,
"EnablePerformanceCountersCollection": true,
"HttpAutoCollectionOptions": {
"EnableHttpTriggerExtendedInfoCollection": true,
"EnableW3CDistributedTracing": true,
"EnableResponseHeaderInjection": true
},
"LiveMetricsInitializationDelay": "00:00:15",
"EnableLiveMetrics": true,
"EnableLiveMetricsFilters": true,
"EnableQueryStringTracing": false,
"EnableDependencyTracking": true,
"DependencyTrackingOptions": null,
"TokenCredentialOptions": null,
"DiagnosticsEventListenerLogLevel": null,
"EnableAutocollectedMetricsExtractor": false,
"EnableMetricsCustomDimensionOptimization": false
}
2024-04-30T18:43:32.668 [Information] LoggerFilterOptions
{
"MinLevel": "None",
"Rules": [
{
"ProviderName": null,
"CategoryName": null,
"LogLevel": null,
"Filter": "b__0"
},
{
"ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
"CategoryName": null,
"LogLevel": "None",
"Filter": null
},
{
"ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
"CategoryName": null,
"LogLevel": null,
"Filter": "b__0"
}
]
}
2024-04-30T18:43:32.668 [Information] LanguageWorkerOptions
{
"WorkerConfigs": [
{
"Description": {
"Language": "dotnet-isolated",
"DefaultRuntimeName": null,
"DefaultRuntimeVersion": "8.0",
"SupportedArchitectures": null,
"SupportedOperatingSystems": null,
"SupportedRuntimeVersions": null,
"SanitizeRuntimeVersionRegex": null,
"WorkerIndexing": "true",
"Extensions": [
".dll"
],
"UseStdErrorStreamForErrorsOnly": false,
"DefaultExecutablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
"DefaultWorkerPath": "C:\\home\\site\\wwwroot\\FunctionStartFailure.dll",
"WorkerDirectory": "C:\\home\\site\\wwwroot",
"Arguments": [],
"WorkerArguments": null
},
"Arguments": {
"ExecutablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
"ExecutableArguments": [],
"WorkerPath": "C:\\home\\site\\wwwroot\\FunctionStartFailure.dll",
"WorkerArguments": []
},
"CountOptions": {
"SetProcessCountToNumberOfCpuCores": false,
"ProcessCount": 1,
"MaxProcessCount": 10,
"ProcessStartupInterval": "00:00:10",
"ProcessStartupTimeout": "00:01:00",
"InitializationTimeout": "00:00:10",
"EnvironmentReloadTimeout": "00:00:30",
"ProcessRestartInterval": "00:00:10",
"ProcessShutdownTimeout": "00:00:10"
}
}
]
}
2024-04-30T18:43:32.668 [Information] ConcurrencyOptions
{
"DynamicConcurrencyEnabled": false,
"MaximumFunctionConcurrency": 500,
"CPUThreshold": 0.8,
"SnapshotPersistenceEnabled": true
}
2024-04-30T18:43:32.668 [Information] FunctionResultAggregatorOptions
{
"BatchSize": 1000,
"FlushTimeout": "00:00:30",
"IsEnabled": true
}
2024-04-30T18:43:32.668 [Information] SingletonOptions
{
"LockPeriod": "00:00:15",
"ListenerLockPeriod": "00:01:00",
"LockAcquisitionTimeout": "10675199.02:48:05.4775807",
"LockAcquisitionPollingInterval": "00:00:05",
"ListenerLockRecoveryPollingInterval": "00:01:00"
}
2024-04-30T18:43:32.668 [Information] ScaleOptions
{
"ScaleMetricsMaxAge": "00:02:00",
"ScaleMetricsSampleInterval": "00:00:10",
"MetricsPurgeEnabled": true,
"IsTargetScalingEnabled": true,
"IsRuntimeScalingEnabled": false
}
2024-04-30T18:43:32.669 [Information] Starting JobHost
2024-04-30T18:43:32.670 [Information] Starting Host (HostId=function-start-failure, InstanceId=4d1a7333-5d28-4f7c-965e-9637852942cb, Version=4.33.1.22394, ProcessId=5728, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~4)
2024-04-30T18:43:32.701 [Information] Loading functions metadata
2024-04-30T18:43:32.804 [Information] You must install or update .NET to run this application.
2024-04-30T18:43:32.804 [Error] App: C:\home\site\wwwroot\FunctionStartFailure.dll
2024-04-30T18:43:32.804 [Information] Architecture: x64
2024-04-30T18:43:32.804 [Information] Framework: 'Microsoft.WindowsDesktop.App', version '8.0.0' (x64)
2024-04-30T18:43:32.804 [Information] .NET location: C:\Program Files\dotnet\
2024-04-30T18:43:32.804 [Information] No frameworks were found.
2024-04-30T18:43:32.805 [Information] Learn more:
2024-04-30T18:43:32.805 [Error] https://aka.ms/dotnet/app-launch-failed
2024-04-30T18:43:32.805 [Information] To install missing framework, download:
2024-04-30T18:43:32.805 [Information] https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
2024-04-30T18:43:32.806 [Error] Exceeded language worker restart retry count for runtime:dotnet-isolated. Shutting down and proactively recycling the Functions Host to recover
2024-04-30T18:43:37.829 [Information] Host lock lease acquired by instance ID '740fb47444741eb75df61a3f5042f4e1'.
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked FunctionStartFailure reproduction repository and deploy the isolated-worker app using net8.0-windows with Azure.Identity, then compare it with net8.0 and without Azure.Identity. Use the supplied host-startup logs as the failure baseline, especially the missing Microsoft.WindowsDesktop.App 8.0.0 message. Done means the HTTP trigger loads in the reported deployment configuration without the language worker restart loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.