I am trying to implement a very basic functionality, as follows: when a row is added in an Azure SQL Database the contents of that row are sent to a Service Bus Queue.
(1)How do I send the ‘row’ as parameter to the ‘send message content’? (2)What kind of object does ‘get row’ create, and what kind of formatting does it need to be sent over to the Service Bus Queue? (3)Can’t this whole operation be done with an Azure Function, rather than logic apps ? (I couldn’t find an SQL trigger for Azure Functions).
Thank you in advance.
2
Answers
There is no SQL trigger for azure functions. But, if you want to use azure functions for doing the same operation, you could use a
HttpTrigger
in logic app.Just pass in the Unique Identifier of the inserted row as query parameter or in the request body. Then, read the data from DB and do the processing in azure functions.
If you are going the service bus route, you can
pass data in JSON format
and de-serialize this JSON at the retrieving end.Created a compose action to get newly added row content as shown below:
Assigned value of compose to a variable as shown below:
In send message action, giving value of variable in content.
Logic app ran successfully.
Message received in service bus queue.
You can get primary column by writing expression as “triggerBody()?[primarycolumnname]”