Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 441 forks source link

The function Runtime is unable to start #3947

Open securityvoid opened 5 years ago

securityvoid commented 5 years ago

I have a function app that will not run and immediately stops. I do not see any errors in the logs indicating why its stopping, or what is happening.

This application worked at one point when deployed to a different function app name. The only real difference should have been the addition to a function proxy, and deployment to a new function app name. However, we're also now doing a ZIP deploy kicked off from Azure DevOps instead of pulling the code from Azure Repos directly.

Error from the console:

Error:
The function runtime is unable to start.
Session Id: f6e6fe27e9734e1ca60776303504a573
Timestamp: 2019-01-14T16:30:41.921Z

Repro steps

  1. Start the function app.
  2. Navigate to any function URL.

NOTE: You receive: Function host is not running.

securityvoid commented 5 years ago

I may have a workaround. I changed the FUNCTIONS_EXTENSION_VERSION to ~1 and restarted, and it looks like things are at least working initially.

kakins commented 5 years ago

I was getting this error initially, tried changing the FUNCTIONS_EXTENSION_VERSION to ~1 and the error still displayed. I changed it back to ~2, logged out of Azure and back in and suddenly it started working.

gsscoder commented 4 years ago

My situation is more weird, when I create the Function App with portal UI and deploy with VSStudio everything works. When I deploy with Az Module / Az CLI, I got this error (and more errors on portal UI).

If I compare properties of functions, I can't see differences.

balag0 commented 4 years ago

@gsscoder Please share the function app name/ timestamp and the command you are using to deploy using Az CLI

gsscoder commented 4 years ago

Hi @balag0, thank you for replying! name: iai-europe-search-func-apis-v1x-lats12 lastModifiedTimeUtc: 2020-05-08T12:00:54.510000 (don't sure this is the timestamp you want)

Only this particular Function App has problems. I solved the main (errors in AppInsights) provisioning the function with an ARM template.

    $params = @{
        subscriptionId = $SubscriptionId
        name = $name
        location = $location
        hostingEnvironment = ""
        hostingPlanName = $plan
        serverFarmResourceGroup = $group
        alwaysOn = $true
        storageAccountName = $storageAccount
        appInsightsKey = (Get-AzApplicationInsights -ResourceGroupName $group -Name $appInsights).InstrumentationKey
    }
    $template = [System.IO.Path]::Combine($global:ScriptPath, 'template', 'functionApp.json')
    New-AzResourceGroupDeployment -ResourceGroupName $group -TemplateParameterObject $params -TemplateFile $template | Out-Null

Than I call az webapp config to add custom settings, az webapp cors for configure CORS and az webapp auth for AAD.