gpt4 book ai didi

c# - 函数的监听器无法启动。为什么?

转载 作者:行者123 更新时间:2023-11-30 18:15:25 27 4
gpt4 key购买 nike

当我从 Visual Studio 运行 azure 函数时,出现以下错误。

A ScriptHost error has occurred [1/19/2018 6:40:52 AM] The listener for function 'MyFunctionName' was unable to start. Microsoft.WindowsAzure.Storage: Server encountered an internal error. Please try again after some time.

当我从命令提示符运行 func host start 时命令。我收到以下警告。然后它就卡在了

Host lock lease acquired by instance ID

.

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

Azure函数版本:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6b7aca3a4b3fbb0a3b8b5a2bfb9b8a5fbb5b9a4b3fba2b9b9baa596e4f8e6f8e7fbb4b3a2b7f8e4e4" rel="noreferrer noopener nofollow">[email protected]</a>我正在使用存储帐户 Blob 容器和队列。

我正在连接到开发存储帐户,我已检查存储模拟器是否已启动。

{
"IsEncrypted": false,
"Values": {
"ConnectionStrings:Default": "Server=.\\SQLEXPRESS; Database=TestDb; Trusted_Connection=True;",
"ConnectionStrings:BlobStorageAccount": "UseDevelopmentStorage=true",

"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
}
}

仅供引用。

之前工作正常,但我在 Visual Studio 中收到此消息。

your license has gone stale and must be updated. Check for an updated license to continue using this product

所以我刚刚删除了%localappdata%%temp%,然后我尝试运行Azure功能,在此之后,我开始得到

The listener for function was unable to start error

这与我的 Visual Studio 订阅有关还是我错误地删除了任何必需的文件?或者这与其他事情有关?

最佳答案

如果您在本地通过存储模拟器运行,则运行 func settings add AzureWebJobsStorage UseDevelopmentStorage=true in local.settings.json

如果使用 func 具有正常的 Azure 存储连接字符串,则必须在 local.settings.json 中设置 AzureWebJobsStorage。
最终的 JSON 如下所示:

{
// some variables
"Values": {
// some variables
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
},
}

了解更多 view

关于c# - 函数的监听器无法启动。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48335887/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com