简体   繁体   中英

Function host is not running

I have a Function App in azure and when I hit the URL of the function app it says "Function host is not running." I am not sure where I have to check and what needs to be changed. I tried restart but still no luck.

This usually means that there is some bad configuration in your function app which is causing the host to fail to start up. Things like having an invalid host.json or an invalid proxies.json file are a possible cause.

To diagnose, it's best to look at the function host logs. If you open your function app in the Azure portal and turn on log streaming, you should be able to get more information about what's going on.

If you're not able to find anything, please let us know the name of your function app either publicly or privately and we can help take a look at the logs for you.

我在添加依赖注入支持后得到了这个 - 我在启动类中有一个错误,它阻止了主机启动。

Thanks for responding. I see that time trigger function in it is getting an error thats causing host to stop.I resolved the error now Function host is working fine.

在 Azure Function v2 中,您需要在host.json中设置运行时版本

So in my case I've had this issue. So basically KUDU failed to delete app_offline.htm after the function was created\\updated.

Make sure to transfer configuration from trigger's like an Event Hub or a Service Bus to settings->configuration in your Azure Function App resource.

在此处输入图像描述

I have had this problem all the time when I upgrade Microsoft.NET.Sdk.Functions 4.1.1 to Microsoft.NET.Sdk.Functions 4.1.2 If you are using 4.1.2 may sure you downgrade and your problem will be resolved likely.

In my case it was due to bad configurations in service bus trigger, please find below configurations after correction

[FunctionName("MyServiceBusSubscriber")]
    public async Task MyServiceBusSubscriberListener([ServiceBusTrigger(topicName: "%TopicName%", subscriptionName: "%SubscriptionName%", Connection = "ServiceBusConnectionString")] string message)
    {            
        await Process(message);
    }

here is my local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "ServiceBusConnectionString": "",
    "TopicName": "",
    "SubscriptionName": ""
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM