Azure Function fails with “Host initialization error” after deployment

Vu Chau 25 Reputation points
2026-07-28T19:58:23.7166667+00:00

I deployed a .NET 8 isolated Azure Function to Azure, but the function app fails to start and shows a Host initialization error in the logs. The same function runs correctly on my local machine using func start.

I first verified that the FUNCTIONS_WORKER_RUNTIME setting was correctly configured as dotnet-isolated, ensuring the Function App was using the proper runtime. After that, I confirmed that all required environment variables were present in the Azure configuration and matched the values used during local development. I also checked for any missing binding extensions that might prevent the host from initializing correctly.

To rule out deployment issues, I rebuilt the project and redeployed the Function App multiple times. I reviewed the .NET isolated worker startup configuration to ensure no breaking changes or misconfigurations were introduced during recent updates. Finally, I validated that the deployment package structure matched Azure’s expected layout, including the correct placement of binaries, host.json, and worker files. I’m looking for guidance on how to diagnose host initialization failures in .NET 8 isolated Azure Functions. Are there known issues, common misconfigurations, or recommended debugging steps for this type of startup failure?

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


Answer accepted by question author
Pravallika KV 18,850 Reputation points Microsoft External Staff Moderator
2026-07-29T01:25:07.3+00:00

Hi @Vu Chau ,

When an Azure Function App shows “Host initialization error” after deployment (but works locally with func start), it’s usually pointing to a runtime startup/config/environment problem rather than your deployment package alone.

Here are the most relevant, practical checks and debugging steps based on the provided documentation.

  1. Confirm the Function host is actually starting in Azure
  • Open the Azure Functions homepage in the portal. If the Functions Host is running, you’ll see it there (unless the homepage was disabled).
  1. Verify the correct Azure Functions runtime version
  • Make sure your Function App is targeting the right Azure Functions Runtime version for your app.
  • If it’s mismatched, the host can fail during startup.
  1. Storage account settings (critical for host startup)
  • If the Function App is on the Consumption plan, the host depends on the storage account configuration.
  • Verify storage account settings and recovery-related requirements (for example, ensure the storage settings aren’t deleted/misconfigured).
  1. Review the logs for the real startup exception
  • Check Application Insights exceptions if enabled.
    • The guidance suggests querying the exceptions table to see the underlying failure.
  • If you don’t have Application Insights or want more details, you can also use Kudu/SCM logs:
    • Check Kudu SCM event log at: D:\Logfiles\Eventlog,xml

A very useful “quick visibility” step is to turn on extra host file logging temporarily:

  • In Host.json, set fileLoggingMode to always to capture more debug output during startup.
  • Those logs will appear in Kudu at:
    • D:\home\LogFiles\Application\Functions
    • For production, the recommendation is to revert to the default debugOnly after troubleshooting.

From the “Application Issues post deployment” guidance, runtime failures after deployment often come from things like:

  • Network connectivity to a secure storage account (host can’t start)
  • Function App configuration issues (incorrect runtime/language version, trigger connection strings, key vault settings, etc.)
  • External dependencies (DB/messaging) causing timeouts during startup
  • Code assumptions about paths that exist locally but not in Azure
  • Azure Functions runtime sandbox restrictions

Also try restarting the Function App (simple but effective)

  • Manually restart the Functions app to see if startup succeeds.

Use Azure Functions Diagnostics

  • Run the Azure Functions Diagnostics tool to quickly diagnose common host/app issues.

If you recently edited host.json/function.json or changed application settings, the platform restarts the host to apply changes.

  • Modifying host.json restarts the host and Adding/removing Application Settings restarts the main process
  • Application Insights can be used to confirm whether restarts happened, via queries that look for:
    • Host configuration has changed. Signaling restart
      • and “File change … detected”
  • Activity logs can also show Update web sites config operations during the timeframe.

Hope this helps!


If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. kagiyama yutaka 4,915 Reputation points
    2026-07-29T05:20:56.3933333+00:00

    I think that the points to check for a .NET 8 isolated host‑initialization failure are AzureWebJobsStorage connectivity and the first startup exception in Application Insights, and both can be viewed in the Azure portal to identify the cause.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-07-28T19:58:54.8533333+00:00

    For a .NET 8 isolated Azure Function that works locally with func start but fails in Azure with host initialization errors, the most useful checks are the app runtime settings, deployment payload, and post-deployment diagnostics.

    1. Verify the Azure Function runtime settings match an isolated .NET app.
      • FUNCTIONS_WORKER_RUNTIME must be dotnet-isolated.
      • On Windows, netFrameworkVersion must match the target .NET version, such as v8.0.
      • On Linux, linuxFxVersion must match the isolated stack, such as DOTNET-ISOLATED|8.0.
      • A mismatch between the configured runtime and the deployed payload can raise diagnostic event AZFD0013.
    2. Check for a runtime/payload mismatch.
      • AZFD0013 occurs when the FUNCTIONS_WORKER_RUNTIME app setting specifies one stack, but the deployed artifacts indicate another.
      • For a .NET isolated app, the expected FUNCTIONS_WORKER_RUNTIME value is dotnet-isolated.
      • This is especially relevant after migrations or if an older in-process payload was accidentally deployed.
    3. Validate the deployment package layout exactly. If deploying a zip package, the archive should contain the published output directly, not an enclosing parent folder. The extracted root should immediately contain:
      • .azurefunctions/
      • extensions.json
      • functions.metadata
      • host.json
      • worker.config.json
      • the project executable
      • supporting files and directories beside that executable
      The package should match the output of dotnet publish. The generated files should not be edited manually.
    4. Focus on runtime causes after deployment, not only deployment mechanics. If the files in wwwroot are correct, common runtime causes include:
      • lost access to the storage account
      • incorrect runtime or language version settings
      • incorrect trigger connection strings
      • incorrect Key Vault settings
      • external dependency failures or time-outs
      • sync triggers failure
      • code using invalid local-only paths
    5. Use Azure diagnostics and logs to isolate startup failure. Recommended steps:
      • Manually restart the function app.
      • Run Azure Function App Diagnostics.
      • Verify storage connections are configured correctly and the storage account is accessible.
      • Review Application Insights logs for the full exception trace or startup error.
      • If the app was recently migrated or upgraded, review the relevant migration guidance.
    6. If this app was migrated from in-process to isolated, use a staged deployment path. During migration, AZFD0013 can appear temporarily if FUNCTIONS_WORKER_RUNTIME is updated before the new isolated payload is deployed. The recommended approach is:
      • create a staging slot
      • set FUNCTIONS_WORKER_RUNTIME to dotnet-isolated in the staging slot
      • update the .NET stack version if needed
      • deploy the migrated code to staging
      • test in staging
      • swap to production
    7. If startup optimization settings were enabled, confirm all related settings are correct. If WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED=1 is set, all other function app configurations must also be correct or the app might fail to start.

    A practical end-to-end diagnostic path is:

    1. In Azure Portal, confirm FUNCTIONS_WORKER_RUNTIME=dotnet-isolated.
    2. Confirm the app stack version matches .NET 8 (netFrameworkVersion on Windows or linuxFxVersion on Linux).
    3. Inspect the deployed package structure and ensure it is the direct dotnet publish output with no extra parent folder.
    4. Check whether AZFD0013 appears in diagnostics; if it does, align the payload and runtime setting.
    5. Restart the app.
    6. Run Function App Diagnostics.
    7. Review Application Insights startup exceptions.
    8. Verify storage, trigger connection strings, and any Key Vault-backed settings.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.