简体   繁体   English

Azure 函数:函数“Test”的侦听器无法启动。 请验证 Azure 存储模拟器正在运行

[英]Azure function: The listener for function 'Test' was unable to start. Please verify that the Azure Storage Emulator is running

I am getting below error while trying to debug an azure function, which is triggered every 30 secs and creates a file and uploads it on Azure storage account (using Azure Storage Emulator for development).我在尝试调试 azure 函数时遇到以下错误,该函数每 30 秒触发一次并创建一个文件并将其上传到 Azure 存储帐户(使用 Azure 存储模拟器进行开发)。

The listener for function 'Test' was unable to start.函数“Test”的侦听器无法启动。 mscorlib: One or more errors occurred. mscorlib:发生一个或多个错误。 Microsoft.Azure.WebJobs.Host: Please verify that the Azure Storage Emulator is running. Microsoft.Azure.WebJobs.Host:请验证 Azure 存储模拟器是否正在运行。 Microsoft.WindowsAzure.Storage: The remote server returned an error: (500) Internal Server Error Microsoft.WindowsAzure.Storage:远程服务器返回错误:(500) 内部服务器错误

Although the Azure Storage Emulator is up and running.尽管 Azure 存储模拟器已启动并正在运行。 Below is the my local.settings.jason -下面是我的 local.settings.jason -

在此处输入图片说明

Any pointers please?请问有什么指点吗?

Since you use a locally virtualized Storage Emulator, then your Connecting String is correct.由于您使用本地虚拟化存储模拟器,因此您的连接字符串是正确的。

If your firewall restricts func from accessing the Storage Account, then this error may be reported.如果您的防火墙限制 func 访问存储帐户,则可能会报告此错误。 The firewall is one of the reasons that the listener cannot access the virtual Storage Emulator.防火墙是监听器无法访问虚拟存储模拟器的原因之一。

When running the function locally, all triggers except httptrigger need to use the Storage Emulator.在本地运行该函数时,除 httptrigger 之外的所有触发器都需要使用存储模拟器。 If the firewall restricts the listener's access to virtual storage, problems can occur when performing functions.如果防火墙限制侦听器对虚拟存储的访问,则在执行功能时可能会出现问题。

Try disabling the firewall and see if that resolves the issue.尝试禁用防火墙,看看是否可以解决问题。

Of course, it is also possible that the Storage Emulator service is not open.当然也有可能是Storage Emulator服务没有打开。 Try typing尝试打字

"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" status

in cmd to check the status.在cmd中查看状态。

If it returns false, enter the following command to start the Storage Emulator:如果返回 false,请输入以下命令以启动存储模拟器:

"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" init
"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start

To sum up:总结:

This type of problem is generally for three reasons.这种类型的问题通常是由三个原因造成的。

1.Connection string error prevents connection, 1.连接字符串错误阻止连接,

2.firewall is set 2.防火墙设置

3.some services are not turned on. 3.部分服务未开启。

Have a look of the doc:看一下文档:

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#start-and-initialize-the-storage-emulator https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#start-and-initialize-the-storage-emulator

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#storage-emulator-command-line-tool-reference https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#storage-emulator-command-line-tool-reference

I would only comment an additional scenario;我只会评论一个额外的场景; I was having the same issue on my local storage emulator, due to the fact that I had previously deleted the localdb (therefore deleting the emulator's db);我在本地存储模拟器上遇到了同样的问题,因为我之前删除了 localdb(因此删除了模拟器的 db); then I created the emualtor's db by hand on ssms, which led to this error.然后我在 ssms 上手动创建了模拟器的数据库,这导致了这个错误。 If you are on a similar situation, make sure you have deleted any emulator related mdf or ldf files on user root folder, and then let the emulator create the db it requires ( AzureStorageEmulatorDb510 ) by running AzureStorageEmulator.exe init .如果您遇到类似情况,请确保您已删除用户根文件夹中任何与模拟器相关的 mdf 或 ldf 文件,然后让模拟器通过运行AzureStorageEmulator.exe init创建它所需的数据库 ( AzureStorageEmulatorDb510 )。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 函数的侦听器无法启动。 Azure 函数应用时间触发器 - Listener for function was unable to start. Azure function app timetrigger function '' 的侦听器无法启动。 Azure 耐用 function VS 2022 - The listener for function '' was unable to start. Azure durable function VS 2022 函数“SignalR”的侦听器无法启动。 与信号器绑定的 Azure 函数 - The listener for function 'SignalR' was unable to start. Azure function binding with signalr function 'IotHubTrigger' 的侦听器无法启动。 物联网中心 - The listener for function 'IotHubTrigger' was unable to start. IoTHub 函数的侦听器无法启动。 为什么? - The listener for function was unable to start. Why? function 'functionName' 的侦听器无法启动。 &lt;--- 禁止 - The listener for function 'functionName' was unable to start. <--- Forbidden Azure function 'Sometestfunction' 的侦听器无法启动 - Azure The listener for function 'Sometestfunction' was unable to start Azure function 的侦听器在本地运行 Azure ZC1C42544268E68384F11 时出现无法启动错误。 如何解决这个问题? - Listener for Azure function was unable to start error while running Azure function app locally. How to solve this? 功能无法启动。 Microsoft.Azure.DocumentDB.Core:必须为此操作提供 PartitionKey 值。? - Function was unable to start. Microsoft.Azure.DocumentDB.Core: PartitionKey value must be supplied for this operation.? Azure function 在 linux 上出现“侦听器无法启动”错误 - Azure function gets 'Listener unable to start' error on linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM