简体   繁体   中英

The listener for function 'Function1' was unable to start when running a timer function

I am getting this below error when I am running my timer function app in Azure Cloud. It is just a basic code and I wanted the log to be shown in Insight.

异常信息

public static class Function1
{
    [FunctionName("Function1")]
    public static void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log)
    {
        log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
    }
}

在此处输入图像描述

在此处输入图像描述

Here is the workaround I did to identify this issue cause:

  1. Created the Azure Function (Stack: .NET 3.1) of type Timer Trigger with your given timer "0 * * * * *" and the connection string given from the storage account created in Azure portal, which is running successfully (in local):

在此处输入图像描述

2. Deleted the Storage account from the Azure Portal and tried to run the function locally which gave me the error: The listener for function Function1 was unable to start.

在此处输入图像描述

Recovered the Storage Account and then deployed to the Azure Portal Function App and running successfully in cloud also:

在此处输入图像描述

In the Azure Cloud, Yes, as @Skin Said that it would be a Storage Account configuration issue.

Few of the steps to resolve this issue were:

  • Check the AzureWebJobsStorage value contains correct the correct storage account connection string.
  • Check the Storage account is not deleted.
  • Check the Networking Option in the Function App that might be the firewall is blocking/restricting the access to the associated storage account.

It was a firewall issue. Added the appropriate Virtual Network and Su.net under Storage Account > Networking > Firewalls and Virtual Network

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