How to debug Azure Function QueueTrigger locally
Asked Answered
P

1

6

I am developing an azure functions which will be triggered by the azure storage queue. For HTTPTrigger we can debug locally , but am not able to find the way to debug QueueTrigger locally . Can anyone of you tell me how can i acheieve debugging on my local box running function with QUEUETRIGGER . I am having a storage explorer on my local box but it writes on azure cloud storage account .

Penitence answered 25/8, 2017 at 9:43 Comment(2)
Just have a dedicated queue for debugging and send a message to that queueGel
Just launch your runtime as you'd for http, then put the message on the queue. It should trigger your function even locally. If the queue is shared with your Azure instances it may be a race condition depending on who grabs the message first, so you may wanna have a test queueLegator
D
8

Can anyone of you tell me how can i acheieve debugging on my local box running function with QUEUETRIGGER . I am having a storage explorer on my local box but it writes on azure cloud storage account.

If you'd like to test/debug your Azure functions app against the storage queue locally, without using Azure storage account, you can install the Microsoft Azure storage emulator that provides a local environment that emulates the Azure Blob, Queue, and Table services for development. purposes.

edit:

As my function was deployed on the Azure, so the message from the queue from getting consummated by the functions running on AZURE

Your WebJob on Azure and local consume message from same storage account, if you want only local WebJob function is triggered, as you said, you can disable your WebJob on Azure. Besides, as I mentioned, for testing/debuging your Azure WebJob functions locally, you can use Microsoft Azure storage emulator.

Dormeuse answered 25/8, 2017 at 9:53 Comment(7)
Hi , its not about not using storage account. its about how to trigger the queuetrigger locally while debugging the azure function on my visual studio.Penitence
Hi Thanks , its done. As my function was deployed on the Azure , so the message from the queue from getting consummated by the functions runing on AZURE. I disabled the function on azure and debugged locally and the message was started to come into my debug window.Penitence
Glad to hear you sole the problem. Besides, as I mentioned, for testing/debuging your Azure WebJob functions locally, you can use Microsoft Azure storage emulator.Dormeuse
Thanks Fred, I tried with the Emulator and it worked too. Once again thanks very much for your guidance.Penitence
If my reply is helpful, you can mark it as answer, which can help others quickly find this thread and solve the similar issue.Dormeuse
Done it. Regards , DineshPenitence
I am having few queries on Scheduler and logic apps too, regarding the deployment and deployment slots [ staging ,production]. If you get time then please do look at those questions too and if possible then do try to answer it if its in your domain area.Penitence

© 2022 - 2024 — McMap. All rights reserved.