简体   繁体   中英

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. 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 '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

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'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

You can use local storage account , if you're using Windows 10 machine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM