Define incoming trigger event in Azure functions app terminology - azure

https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale says:
Event driven. Scale out automatically, even during periods of high
load. Azure Functions infrastructure scales CPU and memory resources
by adding additional instances of the Functions host, based on the
number of incoming trigger events.
Do activity functions being called by an orchestrator function count as an "incoming trigger event"?
Such as
yield context.df.callActivity('myActivity', {})
What about an orchestrator function being called by another type of trigger function, such as a queue trigger?
Such as:
const instanceId = await client.startNew('MyOrchestrator", undefined, {});

I believe YES to - activity functions being called by an orchestrator function count as an "incoming trigger event". If we assume that the trigger is an event, then an orchestration instance will require an event in order to run the activity functions and invoke other orchestration functions.
What about an orchestrator function being called by another type of trigger function, such as a queue trigger?
As mentioned in this MS Doc, we may call it as incoming trigger event because orchestration functions can be called using orchestrator client bindings (client function is the non-orchestrator function).

Related

Unable to select durable function in Azure Logic app editor

I have created a python durable function
So there is a trigger function(HTTP) - that should be accessible from Logic app, orchestrator function, and activity.
However, if I want to select this function in a logic app I cannot see it
After reproducing from my end, I could able to see the HTTP Trigger functions where the route is set to null.
To reproduce we have created 2 HTTP functions
Function1 where the route is set to null
Function2 where the route is not set to null
In my logic app

I want to invoke one durable function when new message received to service bus queue and need to pass same message to durable function

I want to invoke one durable function when new message received to service bus queue and need to pass same message to durable function.
and the total procedure should be done in python stack

Does EventGridTrigger wors in App service plan and ASE?

I have an Event Grid Trigger Azure function deployed to a function app which is in an ASE. I have created an event grid subscription with this function as an end point. The purpose of this subscription is to call this function once a blob file is created.
When I placed the file in the location, the event is supposed to call the function but I see the event is undelivered.
How can I resolve the issue?
I found this in Azure documents :
" When your function app runs in either an App Service plan or an App Service Environment, you can use non-HTTP trigger functions. For your functions to get triggered correctly, you must be connected to a virtual network with access to the resource defined in the trigger connection. "
Maybe you can refer to this article.enter link description here
I have created an eventgrid subscription that writes the event to a queue whenever a file is created in blob. I have modified exiting EvenGridTrigger function to QueueTrigger function. Both storage account and function app are in same vnet.

Azure Function: Http Trigger instead of Blob Trigger for more resilient operations

I have a scenario where I write some data to an azure storage blob, trigger an azure function to process the data, and write the result to another blob storage record. I've come across a weird scenarios where if the function hasn't triggered for a while(couple days) it will stop responding to the trigger unless I navigate to the azure portal and restart the function. This also happens when I use VSTS to publish the function in my CI/CD pipeline. Again, a restart is required.
To get around this, I would prefer to use an HTTP trigger where I can at least get a status code response to my request and have a better sense that my function has actually been triggered.
Here is the method for the blob trigger that is working:
[FunctionName("ProcessOpenOrders")]
public static async Task Run([BlobTrigger("%TriggerBlobPath%/{name}")]Stream myBlob, string name, TraceWriter traceWriter, [Blob("%OutboundBlobPath%/{name}", FileAccess.Write)] Stream outputStream, ExecutionContext context)
The TriggerBlobPath and OutboudBlobPath are slot setting configurations. This is important because I need the blob storage record name as a parameter so I know what to read and I use the same record name as the output.
For an HTTP trigger, I would need that name in a similar way. My question is how?
Something like this I'm guessing:
public static async Task Run([HttpTrigger] HttpRequestMessage request, [Blob("%InboundBlobPath%/{name}", FileAccess.Read)]Stream myBlob, string name, TraceWriter traceWriter, [Blob("%OutboundBlobPath%/{name}", FileAccess.Write)] Stream outputStream, ExecutionContext context)
but I get the following error:
Microsoft.Azure.WebJobs.Host: Unable to resolve binding parameter 'name'. Binding expressions must map to either a value provided by the trigger or a property of the value the trigger is bound to, or must be a system binding expression (e.g. sys.randguid, sys.utcnow, etc.).
If anyone knows how to implement an HttpTrigger in place of a blob trigger, but get the same functionality, that would be very helpful. Otherwise, if someone has an idea on how to guarantee that the blob trigger actually triggered, that would also be very helpful.
Thanks!
I think the official guidance is to use Event Grid trigger to react on blob events. See Reacting to Blob storage events and Event Grid trigger for Azure Functions.

Routing Event Hub messages to Azure funtion by message type

I've create an Azure Function to listen to an Azure IoT Hub instance. When I post message to the IoT Hub I set a property like so:
Message iotMessage = new Message([myMessage]);
iotMessage.Properties.Add("Type", [MessageType]);
At the Azure Function end I want the Azure function only to receive/process messages that have a Type property and where the Type property equals "MessageType1".
I cannot see a way to do this in an Azure function. Can someone advise if this is possible?
EDIT: this appears to be what you're looking for:
https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-process-d2c#add-a-queue-to-your-iot-hub-and-route-messages-to-it
Your condition would be Type=MessageType1 and you would have the function trigger off of the output queue.
What type of input binding are you using for your Azure Function?
AFAIK, this isn't currently possible in one step. However, there are a few options you have:
connect IoT Hub to a ServiceBus Topic/Subscription, which allows you to do some filtering based on properties. Trigger on the subscription which filters by MessageType1
have a function dedicated to filtering IoT Hub messages. When it matches a MessageType1 message, put that message into a queue. This queue triggers another function which only processes matched messages

Resources