[英]Listener for Azure function was unable to start error while running Azure function app locally. How to solve this?
I have one Azure function app.我有一个 Azure function 应用程序。 I am trying to run that locally but getting the below error.我正在尝试在本地运行它,但出现以下错误。 I have the storage emulator up and running.我已经启动并运行了存储模拟器。 Storage emulator status存储模拟器状态
Storage emulator status存储模拟器状态
I am not sure why it is complaining about 10000 port because my storage emulator is running on 12000,12001, 12002 respectively for blob, queue, table.我不确定为什么它抱怨 10000 端口,因为我的存储模拟器分别在 12000、12001、12002 上运行 blob、队列、表。
Local host file is like below,本地主机文件如下所示,
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
Getting the below error at runtime.在运行时出现以下错误。 Can you pls guide me how the issue can be solved to run the function app locally?您能否指导我如何解决该问题以在本地运行 function 应用程序?
The listener for function 'ABCFunction' was unable to start. function 'ABCFunction' 的侦听器无法启动。 Azure.Core: Retry failed after 6 tries. Azure.Core:重试 6 次后失败。 Retry settings can be adjusted in ClientOptions.Retry.可以在 ClientOptions.Retry 中调整重试设置。 (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)). (无法连接,因为目标机器主动拒绝。(127.0.0.1:10000))(无法连接,因为目标机器主动拒绝。(127.0.0.1:10000))(无法连接因为目标机器主动拒绝。(127.0.0.1:10000)) (无法连接,因为目标机器主动拒绝。(127.0.0.1:10000)) (无法连接,因为目标机器主动拒绝它。(127.0.0.1:10000))(无法建立连接,因为目标机器主动拒绝它。(127.0.0.1:10000))。 Azure.Core: No connection could be made because the target machine actively refused it. Azure.Core:无法连接,因为目标机器主动拒绝。 (127.0.0.1:10000). (127.0.0.1:10000)。 System.Net.Http: No connection could be made because the target machine actively refused it. System.Net.Http:由于目标机器主动拒绝,无法建立连接。
As you mentioned, your storage emulator is running on port 12000, 12001, 12002. You can try the following.如您所述,您的存储模拟器在端口 12000、12001、12002 上运行。您可以尝试以下操作。
Check if endpoint is running检查端点是否正在运行
In CMD
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe status
Check storage emulator sql database is created and can start检查存储模拟器 sql 数据库是否创建并可以启动
AzureStorageEmulator.exe init
Check if have port conflict issue检查是否有端口冲突问题
AzureStorageEmulator.exe start
Change to other ports if needed如果需要,更改为其他端口
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.config
Then然后
AzureStorageEmulator.exe start
You can also explicitly specify the AzureWebJobsStorage
to the url you specified您还可以将 AzureWebJobsStorage 显式指定为您指定的AzureWebJobsStorage
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:12000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:12001/devstoreaccount1;
I am also facing the same issue.我也面临同样的问题。
I can fix this by using below steps:我可以使用以下步骤解决此问题:
Make sure you run your Storage Emulator with Admin privileges.确保以管理员权限运行存储模拟器。 Which was already mentioned by @ Thiago Custodio . @Thiago Custodio已经提到过。
Killing the Function process & host process in the task manager在任务管理器中杀死Function进程&宿主进程
Now I can able to run the azure function without issue:现在我可以毫无问题地运行 azure function:
i had this issue and for some reason the emulator wasnt even installed, i installed it from here https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator and now works fine, not sure why wasnt installed我遇到了这个问题,由于某种原因甚至没有安装模拟器,我从这里安装了它https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator现在工作正常,不是确定为什么没有安装
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.