Azure Queue Trigger not firing when deployed - azure

I am new to Azure and most cloud technologies but I am trying to learn. Recently I created a queue trigger in Visual Studio Code and I ran a HTTP trigger that sent messages to the queue and created a queue trigger that printed it out to logs. When I deploy this to Azure I am able to call the HTTP trigger to put items in the queue, but for some reason the queue trigger is not firing. Have you guys encountered this problem?
When I run it locally it seems to trigger but when I deploy it nothing happens.
json file
queue trigger

Are you sure the queue trigger will be triggered by the storage queue? Have you configured the queue trigger correct? Any way, please show your code and related files such as function.json or local.settings.json

Related

What happens to a queued message from a Azure Log App + Azure Queue?

Question
Does the Azure Queue step (within the Logic App) auto-dequeue messages?
Here's some context:
I have a logic app which is setup to insert a string into an azure queue.
Upon being enqueued, a function app is invoked via a queue trigger.
By the time my function app processes this message, the queue is now empty.
Or does the queue trigger processed by my function app (which doesnt explicitly dequeue/delete any queued message) does the auto-dequeing?
I noticed that when i test the queue by manually inserting a message into the queue (via Azure Storage Explorer), the message does disappear on its own. So this makes me think the queue trigger somehow auto-removes the message (i.e. dequeues it)?
Thanks.
I do not understand the question:
Does the Azure Queue step (within the Logic App) auto-dequeue messages?
Queueing a message doesn't dequeue a message. That is done by the azure function that is triggered by that same queue. Once the message is processed successfully the function runtime will mark the message as being completed so it won't show up again. If it fails it is retried up to a certain amount of retries.
So:
Or does the queue trigger processed by my function app (which doesnt explicitly dequeue/delete any queued message) does the auto-dequeing?
Yes!
See this GitHub issue for reference. Too bad it isn't explicitly mentioned at the docs

Queue triggers not working directly after deployment

I have a (C#-based) Function App on a consumption plan that only contains queue triggers. When I deploy it (via Azure DevOps) and have something written to the queue, the trigger does not fire unless I go to the Azure Console and visit the Function App. It also works to add an HTTP trigger to the App and call that. After that, all other triggers work.
The same phenomenon is observed with Timer triggers.
My hypothesis is that these triggers only work when the runtime is active but not directly after deployment when no runtime was created. Is that true? If so, what is the suggested way around this?
My only workaround idea is to add an HTTP trigger and fire regular keepalive pings to that trigger. But that sounds wrong.

Azure Functions: Can I have different configuration for BlobTriggered function?

I have a .Net project which contains, multiple trigger in a same azure function project (a blob triggered function & a Queue triggered function).
I need a different concurrency for my blob triggered function from queue triggered function.
I know that the blob trigger uses a queue internally.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob#trigger---poison-blobs
Is there any way I can achieve it?
Like #Sebastian has said, I am afraid you can only achieve this by putting blobtrigger in another Function app.
Settings in host.json regulate behavior of the whole Function app. And We can't separately customize settings for each trigger.
In your case, queue message concurrency settings(bactchSize and newBatchThreshold) influence all triggers that consume messages concurrently.
Rather than using blob trigger, you should try eventgrid trigger:
Reacting to Blob storage events
Event Grid trigger for Azure Functions
Using the eventgrid trigger which is a "custom" http trigger, any time a blob is added/deleted in any containers of your storage account, your endpoint will be called without any delay.

Azure triggered webjob not triggering when there are message in azure service bus

I have a web job that is supposed to be a triggered web job. I have it been deployed to azure fine and it is listed as a triggered webjob. However when I add things to the azure service bus that it has a function for. When i trigger it from the UI it works and will respond to my messages.
My host is configured like so
var config = new JobHostConfiguration
{
JobActivator = new MyActivator(container)
};
config.UseServiceBus();
var host = new JobHost(config);
host.RunAndBlock();
My Function looks something like this
public void ProcessQueueMessage([ServiceBusTrigger("recipetest")] ProductName message, TextWriter log)
{
//code
}
I have been looking for a while now but all google searches have given me back continuous web jobs with function triggers. Can anyone tell me how to get the web job to wake up and handle messages. I have found most other answers talk about always on but triggered jobs should work without always on.
In my opinion, the differences between continuous webJob and trigger webjob is as below:
Continuous webJob: Always run a backend exe in the web application.
In webjob SDK ServiceBusTrigger scenarios, even though your individual functions are 'triggered', the WebJob as a while runs continuously (i.e. your exe keeps running and does its own internal triggering).
Triggered webjob: Triggered by schedule or manually.
Notice: Webjobs are all run by the web app's process and web apps are unloaded if they are idle for some period of time. This lets the system conserve resources.
So both Continuous and Triggered (scheduled CRON) webjobs require 'Always on'.
To use ServiceBusTrigger, your WebJob has to be continuous.
To add a little more detail, the ServiceBusTriggerAttribute actually does poll the Message Queue that it monitors using a backoff if no messages are found. So you can see that messages added to the queue do not "wake up" a WebJob and tell it to do something - instead the ServiceBusTriggerAttribute polls and will find when new messages are waiting to be processed. This is why the WebJob can't be Triggered if you're using ServiceBusTriggerAttribute.

How to implement MSMQ Receive as like Azure Queue?

We are migrating application from Azure to On Prem which has Queue option and decided to implement MSMQ as like Azure Queue but some of the options are not exactly available in MSMQ queue.
AddMessage & Peekmessage in Azure Queue and Send & Peek in MSMQ are Same
GetMessage in Azure Queue is used to get the next queue message and we can set the visibility time to avoid others to process the same queue.
Receive in MSMQ to get the latest message and at the same time it automatically deleted from the queue.
DeleteMessage in Azure Queue, everything is fine after fetching the message from queue then we have to delete the message using DeletMessage but we don't have this option available in MSMQ.
Updatemessage in Azure Queue is used to update the message but we dont have this option in MSMQ.
Please help me, How to implement the GetMessage as like we are using in Azure Queue.
I don't think that there's an easy way to do that.
To delete and get message, you just need to dequeue it and proccess it.
You can do that using method ReceiveById:
https://msdn.microsoft.com/en-us/library/0t877y0k(v=vs.110).aspx

Resources