Upravit

Sdílet prostřednictvím


Resolve "Function App Down or Reporting Errors" issues

Common scenarios, error messages, and symptoms

Microsoft Azure Function App failures typically fit into three major categories: configuration issues, customer code issues, and platform issues. This article explores these issues in detail and introduces the appropriate diagnostic tools for troubleshooting.

Configuration issues

These issues are the most common. They include:

Customer code issues

These issues have the following causes:

  • Faulty code patterns that cause high CPU or memory usage, SNAT exhaustion, or runtime exceptions (for example, division by zero or null reference).
  • Long-running or inefficient functions that are especially problematic on consumption plans because of timeout constraints.

For more information, see the following resources:

Platform issues

These issues are less common but usually have a greater effect:

Typical error messages

You might experience common errors such as the following:

Symptoms to watch for

  • Function not triggering or running. See Analyze Azure Function App telemetry in Application Insights.

  • Missing invocation history or unexpected gaps.

  • High resource consumption (CPU or memory spikes that are flagged by detectors).

  • Timeouts or long response times, especially on Consumption plans (maximum of 230 seconds).

  • Functions not listed on the overview page.

Diagnostic tools

To identify and resolve issues, you can use the following tools in the Azure portal.

Function App Down or Reporting Errors (Preview)

To access this tool, follow these steps:

  1. Sign in to the Azure portal.
  2. Open Function App.
  3. Select Diagnose and solve problems.
  4. Search for Function App Down or Reporting Errors (Preview).

Features of this tool

  • Automates key troubleshooting checks by using existing detectors.
  • Provides minimal noise and focused root cause analysis.
  • Supports conversational diagnostics.

Issue categories

Function app downtime errors are categorized as follows.

Common configuration issues

  • Misconfigured application settings
  • Incorrect or unreachable storage account configuration
  • Key Vault access permission issues
  • Managed Identity authentication problems
  • Binding or trigger misconfiguration
  • Network connectivity issues

Code and runtime resource issues

  • High CPU or memory consumption
  • SNAT port exhaustion
  • TCP connection exhaustion
  • Long-running or stuck functions
  • Runtime exceptions and failures
  • Poor error handling or retry logic

Diagnostic checks performed

The diagnostic workflow evaluates the following aspects of your function spp:

  • General information
    • Hosting plan type (Consumption, Premium, Dedicated, Flex)
    • Runtime version
    • Platform (Linux or Windows)
    • Trigger types and bindings
  • Startup issues
    • Diagnostic events during app startup
    • Offline history analysis for unexpected downtimes
  • Recent deployments
    • Highlights deployments that might have affected the app
  • Runtime and language version validation
    • Confirms use of supported versions
  • Configuration checks
    • Verifies mandatory app settings
    • Verifies Key Vault and Managed Identity configuration
    • Checks for SyncTrigger issues
    • Detects Function Host name collisions
  • Extension versions
    • Identifies outdated or unsupported extensions
  • Hosting plan setup
    • Analyzes configuration and scaling behavior
    • Checks for SNAT port exhaustion, high CPU, and memory issues
    • Includes risk alerts:
      • For Dedicated plans: verifies that AlwaysOn is enabled
      • For Elastic Premium: checks VNet routing and scaling
  • Execution health
    • Detects:
      • Execution failures
      • Nontriggering functions
      • Stuck or long-running executions
  • AI-powered analysis
    • Uses OpenAI to detect issue patterns and provide contextual recommendations

Application Insights queries

For diagnostics, run these queries in Application Insights:

  • Requests per worker (last 30 minutes):

    requests
    | where timestamp > ago(30m)
    | summarize count() by cloud_RoleInstance, bin(timestamp, 1m)
    | render timechart
    
  • Traces for errors (last 30 minutes):

    traces 
    | where timestamp > ago(30m)
    | where customDimensions.LogLevel == "Error"
    
  • Runtime exceptions (last 30 minutes):

    exceptions
    | where timestamp > ago(30m)
    

Note

Sampling is enabled by default. If it's necessary, disable this feature temporarily during an investigation.

For more information, see Analyze Azure Function App telemetry in Application Insights.

Network validator tool

Note

This tool applies to all hosting plans, except for the Windows and Linux Consumption plans.

If your app shows errors such as FAILED TO INITIALIZE RUN FROM PACKAGE.txt or host.json not found, use the network troubleshooter to resolve the errors.

To access the tool, follow these steps:

  1. Sign in to the Azure portal.
  2. Navigate to Diagnose and solve problems.
  3. Search for Connectivity Troubleshooter.

This tool checks for:

  • DNS resolution
  • Storage and Key Vault access
  • Outbound restrictions (VNet, NSG, firewalls)

When you use the network validator, make sure that:

  • VNet integration is correctly configured.
  • No endpoint or firewall blocks are in place.

For more information, see the following resources:

Kudu logs (SCM)

Note

This tool applies to all hosting plans, except for the Linux Consumption and Flex Consumption plans.

For information about how to access and use Kudu logs (SCM), see Access Kudu for your app.

Other logs

  • Host Logs: %HOME%\LogFiles\Application\Functions\Host
  • Functions log: %HOME%\LogFiles\Application\Functions\Function\<your_triggername>
  • System-level log: %HOME%\LogFiles\Eventlog.xml

For more information, see Understanding the Azure App Service file system.