如何实现 Azure Service Bus 队列触发器 / 存储连接错误。

huangapple 未分类评论51阅读模式
英文:

how to implement an azure service bus queue trigger / storage connection error

问题

我想从 Azure 的服务总线队列中获取消息,对于除了 HttpTrigger 和 KafkaTrigger 之外的所有触发器,我需要在本地设置中指定 AzureWebJobsStorage 的值(连接字符串)。我在 Azure 中部署了一个 Blob 存储,所以我获取了存储账户的连接字符串并将其放入了 loca.settings.json 文件中。

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "java",
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=core.windows.net",
    "myConnection": "<Connection string>"
  }
}

但是我从 Azure 收到了一个异常:

The 'messageReceiver' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.messageReceiver'. Microsoft.WindowsAzure.Storage: No valid combination of account information found.

我已经多次检查了连接字符串,它是正确的。他们说我需要删除终结点后缀,但那并没有起作用。
提前谢谢您的帮助。


<details>
<summary>英文:</summary>

I want to fetch messages from service bus queue in azure, for all triggers other than HttpTrigger and kafkaTrigger I need to specify a value (connection string) for AzureWebJobsStorage in local settings. I have a blob storage deployed in azure so I took connection string of the storage account and put it in loca.settings.json

{

"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "java",
"AzureWebJobsStorage" : "DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=core.windows.net",
"myConnection" : "<Connection string>"
}
}


but I get an exception from azure

    The &#39;messageReceiver&#39; function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method &#39;Functions.messageReceiver&#39;. Microsoft.WindowsAzure.Storage: No valid combination of account information found.

I checked multiple times connection string is right. They said I need to remove endpoint suffix but that didn&#39;t work.
Thank you in advance.

</details>


# 答案1
**得分**: 0

**Azure函数存储账户要求**

&gt; 在创建函数应用时,您必须创建或链接到一个支持Blob、队列和表存储的通用Azure存储账户。这是因为函数依赖于Azure存储进行诸如管理触发器和记录函数执行等操作。某些存储账户不支持队列和表。这些账户包括仅支持Blob的存储账户、Azure高级存储以及带有ZRS复制的通用存储账户。在创建函数应用时,这些不受支持的账户将从“存储账户”选项中筛选出来。[详细信息在此][1]

如果您使用的是Windows 10计算机,您可以使用[本地存储账户][2]。

  [1]: https://learn.microsoft.com/en-us/azure/azure-functions/storage-considerations#storage-account-requirements
  [2]: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator

<details>
<summary>英文:</summary>

**Azure Function Storage account requirements**

&gt; When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. This is because Functions relies on Azure Storage for operations such as managing triggers and logging function executions. Some storage accounts don&#39;t support queues and tables. These accounts include blob-only storage accounts, Azure Premium Storage, and general-purpose storage accounts with ZRS replication. These unsupported accounts are filtered out of from the Storage Account blade when creating a function app. [detailhere][1]


You can use [local storage account][2], if you&#39;re using Windows 10 machine


  [1]: https://learn.microsoft.com/en-us/azure/azure-functions/storage-considerations#storage-account-requirements
  [2]: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator

</details>



huangapple
  • 本文由 发表于 2020年4月6日 17:33:50
  • 转载请务必保留本文链接:https://java.coder-hub.com/61056760.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定