QueueTrigger 未在具有托管身份的 Azure 中触发

问题描述 投票:0回答:1

我有一个函数应用程序在本地运行,没有任何问题:

public async Task Run([QueueTrigger("update-or-add-vessel", Connection = "QueueConnection")] QueueMessage vesselJson)
{
}

这是我的本地主机:

{
    "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
    "NotifyCron": "0 0 3 * * WED",
    "Cron": "0 0 7,12,17 * * *",
    "QueueConnection__queueServiceUri": "https://xxx.queue.core.windows.net"
  }

我将设置复制到 Azure: enter image description here }

队列有消息,但函数从未触发。

函数托管身份对存储队列具有处理权限: enter image description here

对于缺少什么或如何排除故障有什么想法吗?没有消息进入有害队列,就像函数应用程序根本不触发一样。

azure azure-functions azure-storage azure-queues
1个回答
0
投票

您没有将其包含在您的问题中,所以我只是在这里刺一下。但是,鉴于您提到它在本地工作,并且我怀疑您在本地开发时使用 SAS 令牌或帐户密钥,请确保您已在 Azure 环境中更新连接字符串以匹配以下格式:

"DefaultEndpointsProtocol=https;AccountName=<your_storage_account_name>;EndpointSuffix=queue.core.windows.net;Credential=ManagedIdentity"

字符串中不应包含 AccountKey 或 SharedAccessSignature。

© www.soinside.com 2019 - 2024. All rights reserved.