Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrew-rheingans opened this issue Apr 30, 2024 · 2 comments
Open
Assignees

Comments

@andrew-rheingans
Copy link

andrew-rheingans commented Apr 30, 2024

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": "<AddFilter>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": "<AddFilter>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'.
@kshyju
Copy link
Member

kshyju commented May 1, 2024

@andrew-rheingans Just curious to know why you need to use net8.0-windows as the TargetFramework value for your dotnet-isolated function app. What are you missing when you use net8.0 as the TargetFramework value ?

@andrew-rheingans
Copy link
Author

I use the function to generate some images and the package that generates those images targets net8.0-windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants