Azure function not reading Azure storage queue message

niharika jain 0 Reputation points
2023-04-05T10:13:49.8533333+00:00

I have created a storage account with queue. Then Created a function app with Storage queue trigger based function. I am using developer portal to execute it. The function is getting triggered when I add message in queue but it shows 0 message found. How to solve this? User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-04-10T09:54:00.1+00:00

    @niharika jain Thanks for reaching here! If I have understood right your function is getting triggered but not able to read the message from the queue. There could be multiple reasons for this issue.

    1. Please make sure that you have provided the correct connection string for the storage account in the function app settings. You can check this by going to the function app settings and then to the "Configuration" tab. To obtain a connection string, follow the steps shown at Manage storage account access keys. This connection string should be stored in an application setting with a name matching the value specified by the connection property of the binding configuration.
    2. Please make sure that you have provided the correct queue name in the function code. You can check this by going to the function code and looking for the [QueueTrigger] attribute.
    3. You can set the Connection property to specify the app setting that contains the storage account connection string to use, as shown in the following example:
       [FunctionName("QueueTrigger")]
       public static void Run(
           [QueueTrigger("myqueue-items", Connection = "StorageConnectionAppSetting")] string myQueueItem, 
           ILogger log)
       {
           ....
       }
    
    
    

    If both of these are correct, then please check the logs of your function app to see if there are any errors.

    1. You can do this by going to the function app in the Azure portal, selecting your function, and then selecting the "Logs" tab.

    Reference document: Azure Queue storage trigger for Azure Functions Please let us know if further query issue persists.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.