[英]how to implement an azure service bus queue trigger / storage connection error
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.我想从 azure 中的服务总线队列中获取消息,对于 HttpTrigger 和 kafkaTrigger 以外的所有触发器,我需要在本地设置中为 AzureWebJobsStorage 指定一个值(连接字符串)。 I have a blob storage deployed in azure so I took connection string of the storage account and put it in loca.settings.json我在 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>"
}
}
but I get an exception from azure但我从 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.
I checked multiple times connection string is right.我检查了多次连接字符串是正确的。 They said I need to remove endpoint suffix but that didn't work.他们说我需要删除端点后缀,但这不起作用。 Thank you in advance.先感谢您。
Azure Function Storage account requirements Azure Function 存储帐户要求
When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage.创建 function 应用程序时,您必须创建或链接到支持 Blob、队列和表存储的通用 Azure 存储帐户。 This is because Functions relies on Azure Storage for operations such as managing triggers and logging function executions.这是因为 Functions 依赖于 Azure 存储来执行管理触发器和记录 function 执行等操作。 Some storage accounts don't support queues and tables.某些存储帐户不支持队列和表。 These accounts include blob-only storage accounts, Azure Premium Storage, and general-purpose storage accounts with ZRS replication.这些帐户包括仅限 Blob 的存储帐户、Azure 高级存储和具有 ZRS 复制的通用存储帐户。 These unsupported accounts are filtered out of from the Storage Account blade when creating a function app.在创建 function 应用程序时,这些不受支持的帐户会从存储帐户边栏选项卡中过滤掉。 detailhere 详细在这里
You can use local storage account , if you're using Windows 10 machine您可以使用本地存储帐户,如果您使用的是 Windows 10 机器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.