[英]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.当我在 Azure Cloud 中运行我的计时器 function 应用程序时,出现以下错误。 It is just a basic code and I wanted the log to be shown in Insight.
这只是一个基本代码,我希望日志显示在 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:这是我为确定此问题原因所做的解决方法:
"0 * * * * *"
and the connection string given from the storage account created in Azure portal, which is running successfully (in local): "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.
2. 从 Azure 门户中删除了存储帐户,并尝试在本地运行 function,这给了我错误:
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:恢复存储帐户,然后部署到 Azure 门户 Function App 并在云中成功运行:
In the Azure Cloud, Yes, as @Skin Said that it would be a Storage Account configuration issue.在 Azure 云中,是的,正如@Skin所说,这将是一个存储帐户配置问题。
Few of the steps to resolve this issue were:解决此问题的几个步骤是:
AzureWebJobsStorage
value contains correct the correct storage account connection string.AzureWebJobsStorage
值是否包含正确的存储帐户连接字符串。 It was a firewall issue.这是一个防火墙问题。 Added the appropriate Virtual Network and Su.net under Storage Account > Networking > Firewalls and Virtual Network
在存储帐户 > 网络 > 防火墙和虚拟网络下添加了适当的虚拟网络和 Su.net
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.