How to read ServiceBus Queue message in Azure function using Logic App? - azure

I'm trying to implement a Poc considering the scenario as,
Trigger LogicApp whenever message arrives in ServiceBus Queue. The message will be sent to/read by Azure Function which will be the next action within the LogicApp. After performing some business processes Azure function will return the response back to Logic App. Based on the response from Azure function, LogicApp will trigger few more functions and then they will send the response back to ServiceBus Queue.
I'm able to invoke/trigger LogicApp when a message arrives in ServiceBus queue. Since I'm newbie to Azure and LogicApp, I'm not sure how can I pass message to Azure Function to read and perform business validation within the LogicApp.
Thanks in advance!

Firstly, you need connect service bus to Azure Logic App then in next step by clicking on (+) symbol you can type azure function and follow the below process:
Then click on your Function app:
Then Click on the Azure Function you have in your function app:
Then click on request body and then on Service Bus Message:
So, by this way you can handle Azure Function using Azure Logic Apps:
Taken References from:
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-azure-functions?tabs=consumption
Expose APIs from functions using Azure API Management | Microsoft Docs

Related

Send slack message on Firebase Cloud Functions deployment event

How can I send a slack message whenever a deployment happens on Firebase Cloud functions.
I need to send following data in message: project id, functions deployed, and deployment message if any.
I know how to send slack messages via its api but I'm not aware of any event which gets triggered on Firebase deployment.
There is no simple and automatic way to accomplish the task you are looking for within Firebase. But there is a way in which you can implement it.
To do that you have to create a logging sink that matches the audit log produced when a function is deployed (google.cloud.functions.v1.CloudFunctionsService.CreateFunction) and when a function is updated (google.cloud.functions.v1.CloudFunctionsService.UpdateFunction). Now you can use the logging sink to trigger a Pub/Sub topic as mentioned in this document. Then you can create a Cloud Function which is triggered by that Pub/Sub topic as described in this document so that the Cloud Function will be called on every new deployment. By doing this the entire log is passed into the Cloud Function which will have project id, functions deployed etc. and now within the Cloud Function you can call the Slack API to send the message.

Programmatically create Azure Service Bus bindings for Azure Functions

I am trying to dynamically create an Azure Function (Service Bus trigger) that will respond to messages from a Service Bus queue or topic.
There is a CLI way of creating an Azure Function that acts as an HTTP Trigger. However I havent found a way to create a Service Bus Trigger. Is this even doable ?
** Edit, I am able to programmatically create an Azure Service Bus Queue using this sample code
So really I am hoping to create a function based on the details of the servicebus queue generated at an earlier step and have the function fire from that queue.

Programmatically create azure Service Bus queue and Azure Service Bus trigger for Azure Functions

I am working on a scenario where when I need to create a new servicebus queue and an azure function that is triggered whenever a message is dropped in the said queue. Is there a way to call an API pass in some parameters and have the queue and function created ?
Any inputs will be much appreciated
Technically, You can achieve both as far as i know.
You can create a new function with the CLI command , i do not think there is an API to do the same.
To create a Service Bus queue you can do it with the Nuget package and here is an answer already.

Does Azure's Durable Functions support a Service Bus Queue Trigger in Javascript

I am attempting to follow the tutorial from Microsoft of creating a Durable Function in the Azure Portal. In following the Tutorial I am seeing that the Portal only has templates based off a HTTP Trigger. I was wondering if Durable Functions for Javascript can support Service Bus Queue Triggers?
Link: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-create-portal#create-an-orchestrator-function
After playing with the function.json and luckily finding the following blog post, I did get an Azure Durable Function written in Javascript to be kicked off via the arrival of a message on a Service Bus Queue.
Blog Post: https://simonagren.github.io/intro-durable/

How do i send messages to Azure Service Bus after completion of activity in Azure data Factory

I am trying to send a message to azure service bus through REST API after an activity is completed in Azure data factory pipeline. But how can i generate access token to send messages inside azure data factory.
Azure data factory has only on web activity through which i can call rest endpoints, Is there a solution possible with it.
There is two ways to send messages from ADF to a Service Bus.
First, you need to grant the Azure Service Bus data sender role.
You can then send messages using a copy activity, which allows you to send an entire data set, or using a web activity, which allows you to send a body or a parameter.
Settings in Linked Service for Copy Activity:
Settings in Web Activity:
I recommand that you could use the Azure Httptrigger function to that.
You could implement send message with Azure httptigger function. And Call Http trigger function in the Azure datafactory.
For more information about Azure Httptrigger function, please refer to this tutorial.
And then we could use the Web activity to call an Azure function endpoint from a Data Factory pipeline.
There is a way to use the ADF web activity with to interact with the Service Bus REST api directly using the ADF's managed identitity.
It requires granting relevant permission on the Service Bus namespace for the ADF's managed identity (e.g. by assigning the Azure Service Bus Data Sender role). Rather than generating an access token, you can use the managed identity authentication option in the web activity and set the resource value as https://servicebus.azure.net.
For a worked example please take a look at my blog post on sending messages to service bus from ADF.

Resources