Azure Logic App - Manual trigger with user entered parameters - azure-logic-apps

I've got a logic app that I want to be able to run ad hoc and specify the parameters when run. The closest manual trigger i could find was the HTTP request.
As a workaround, I'm calling it from postman where the JSON body can be defined.
While postman works, I'm looking for a way to trigger the app from within azure and provide the JSON body.
Thank you

Actually there are many way to trigger the logic app and process the json data.
You could try with service bus trigger or blob trigger, the below is my test with servicebus. I send a json message with Service bus Explorer. Note: in the logic app the json data is encoded with base64.
The below is the result.
However from the action you could find it has a Interval property to set, it means it may be not triggered immediately. And mostly other triggers need to set the Interval, so if you want to trigger immediately, suppose the HTTP request is the best.

My workaround is a Recurrence trigger every 1 minute and let it kick off and then edit the trigger to every 1 month and save it. Then I disable the Logic App to make sure it does not trigger automatically.

Related

Azure Logic Apps- Standard Stateful

I understand that Azure standard Stateful Logic app workflow runs Asynchronously but can i use stateful standard logic app for the below scenario:
We want to receive Json data from the third party in a HTTP post request, then process it and store it in Azure data lake. But the problem is since Azure standard stateful workflow runs asynchronously as soon the http trigger is hit it returns Status 202 Accepted. I want to send the caller end status of the request. For example- I want to send 500 Internal server error when the request was valid but still the workflow failed due to an internal error. If the data was processed successfully i want to send the caller HTTP Status 200 Ok. I dont want to send always HTTP status 202 Accepted to the caller. I want the caller to know what exactly happened to their HTTP request. Is it possible through standard logic app? I dont want to use consumption Logic app because of security reasons.
You can achieve this using runafter configuration by enabling this configuration it runs even after the whole workflow is getting failed.
Go to your work flow and select Menu for the action you want to run regardless if the previous one is about to fail, timeout, or skip. It's Condition in my case, and then 'Configure run after'.
For instance here is my logic app
Here is how my code view looks like :
OUTPUT:
UPDATED ANSWER
In that case, too you can use the same runafter concept with the condition having status code is not equal to 200 as a true statement and continue the flow
Here is the logic app
Here is the output

How to read azure service queue message in Logic apps?

I am trying to create small Azure Logic app which will have some order flows.I will get the message in service bus queue. I need to get the message in logic app and based upon the message content, I need to follow the further steps. The message will contain the order data as well. There will be conditional logic, let's suppose, if order type is "new", I need to call HTTP request where I need to pass the message data as body content in POST request.
I have create a service bus queue and in logic apps, added service bus trigger which will be called when message will be received in service bus queue(automatically).
I need to able to implement conditional logic but as i am newbie in this, i am not sure how to pass this data in condtional logic from message.
You just need to mention the condition in the block and design the flow that we require. If the condition is true I have added the HTTP action mentioning the required details. For understanding purpose I have mentioned the other condition to trigger an email.
Here the flow of my logic app
If you want to continue the flow just click Add an action in True Connector.
REFERENCES:
Get started with Azure Service Bus queues (Azure.Messaging.ServiceBus) - Azure Service Bus | Microsoft Docs

Display realtime data in reactjs

I'm sending data from my backend every 10 seconds and I wanted to display that data in reactjs. I've searched on the net to use socket.io to display real-time data. Is there a better way to use it?
If you're dead set on updating your data every 10 seconds, it would make more sense to make a request from the client to the server, as HTTP requests can only be opened from client to server. By using HTTP requests, you won't need to use socket.io, but socket.io is an easy alternative if you need much faster requests.
Depending on how you are generating the data being sent from your backend, specifically if you are using a database, there is most likely a way to subscribe to changes in the database. This would actually update the data in realtime, without a 10 second delay.
If you want a more detailed answer, you'll have to provide more detail regarding your question: what data are you sending? where is it coming from or how are you generating it?
I'm working on an autodialer feature, in which an agent will get a call when I trigger the button from the frontend (using react js language), and then automatically all the leads in the agent assigned portal will get back-to-back calls from agent number. However, because this process is automatic, the agent won't know who the agent has called, so I want to establish a real-time connection so that I can show a popup on the frontend that contains information about the lead who was called.

Is it possible to update an AngularJS expression via an API call through a Service?

I'm looking for a way (and not even sure if this is possible) to update an Angular expression on my HTML page when data is sent to an API.
For example, say I have $scope.message on my .html page. Is there a way I can send a message to an API (e.g. http://...?message=foo) and have my page update with the message sent?
Also, I need the $scope.message to be updated in an Angular Service so it is available to multiple pages within my website.
I am wanting this to be a live update, but if not, I am happy with some code executing on a timer or something similar.
Any suggestions appreciated.
UPDATE
I'm guessing it may not be possible, but just in case I haven't explained it correctly, I'll try and simplify it.
I can only find information about using AngularJS to send GET commands OUT to a URL and receive data back. I need to send a JSON string TO my Angular site to update a variable. So basically as a field updates in my database, I want another server application to send an alert to my Angular site to update the status of this value live. I don't really want to run a constant check of the database if I don't have to.
I am open to any other suggestions on how to achieve this.
if you don't care about old school browsers, you can try using WebSocket, it is similar to a TCP socket, which allows you to push from server to client. I would create a service that manages the websocket connection, and update scope when receiving message. Hope this help. More info here: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

Showing status of a batch update operation using WebApi

I need to know how to update UI with the status of a batch update operation. For example i am sending a request to WebApi to update multiple records (could be any number of records), now i want to show the status of each record to client side.
Please suggest me the best way of doing that. I am using WebApi, Angular. I am thinking about implementing SignalR that can update Client UI with respect to the status but is there an another way of doing that ??
signalr may be overkill for what could be a simple polling request to your api.
It's a little ambiguous as to exactly what it is you are doing with your batch update operation, but since your looking to get status back I'm going to assume it's a long slow operation that your not waiting on a response for in the initial request.
Web api has REST principles baked into it from the start so I imagine your batch update operation is using a PUT with a set of objects that need to be updated. If so you could simply request those objects back from your api to check their state and see if the operation has updated them yet.
If your not doing a simple PUT on an entity and it's more like a POST to submit a batch operation you should persist the operation entity and return a reference to it in the initial call then subsequently poll for that operation by id to get its current status.
signalr might let it feel a little more realtime by immediately pushing completed events down to the client but it can also bring a lot more overhead for what you are trying to achieve

Resources