0

I want to create an azure storage queue triggered azure function. I went through the following tutorial https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger

I basically want to trigger the function whenever a message is pushed into the queue and push the result back to another queue once a function is finished.

function.json

{
  "bindings": [
    {
      "name": "input",
      "type": "queueTrigger",
      "direction": "in",
      "queueName": "queue-trigger",
      "connection": ""
    },
    {
      "type": "queue",
      "direction": "out",
      "name": "output",
      "queueName": "queue-receiver",
      "connection": ""
    }
  ]
}

When i deployed the function, then I am getting the following error in logs present in monitor. enter image description here

2022-09-10T12:16:53.412 [Error] The 'QueueTrigger' function is in error: 

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.QueueTrigger'. 

Microsoft.Azure.WebJobs.Extensions.Storage.Queues: Storage account connection string 'AzureWebJobs<storage account name>_STORAGE' does not exist. Make sure that it is a defined App Setting.

enter image description here

You can see I have defined, three application settings.

  • AzureWebJobs<storage account>_STORAGE
  • AzureWebJobsStorage
  • <storage account>_STORAGE

According to documentation, if connection is empty in function.json then AzureWebJobsStorage will be used.

Even i tried to set connection:"<storage account>_STORAGE", that also raised the same error.

Rahul
  • 1,858
  • 1
  • 12
  • 33
  • As you left the `connection` property empty, have you set the value of AzureWebJobsStorage to point to the queue's conn string ? – Anand Sowmithiran Sep 11 '22 at 10:54
  • I assume in the actual deployed function, `connection` is explicitly set to `"AzureWebJobs_STORAGE"` in your function.json file ? – Mo Nazemi Sep 11 '22 at 12:17

1 Answers1

0

I have reproduced in my environment, and the below workaround worked for me:

I have created a storage account and copied the connection as below and i created a queue too over there as below enter image description here

Then i pasted it in local.settings file in vs studio as below:

enter image description here

And now i published it too azure. Click on App setting in Configuration , if Connection string name is present then open that and paste the connection string. If not Then in published function app i created a connection string in application settings and copied the same connection string that i have taken from Storage account enter image description here

enter image description here Then click on ok then save it. Then send message in queue as below: enter image description here And this workaround worked for me.

RithwikBojja
  • 5,069
  • 2
  • 3
  • 7