I am looking at creating a logic app that needs to be triggered by multiple SharePoint Online Document Libraries. The examples I have seen don't actually show a second trigger, does anyone know if this is possible?
We can create multiple starter triggers. Start with Recurrence action then add more than 1 triggers. See below image.
Instead of multiple Triggers in a single Logic App, it would generally be better to separate the Trigger Logic Apps and processing Logic App.
Then, each Trigger Logic App, as many as you need, would call the single processing Logic App.
Related
I want add a functionality in my ADF pipeline which will send me email notification in case of failure. On searching the internet, I came to know that Azure Logic Apps helps with this. I am trying to follow below link to achieve this.
https://microsoft-bitools.blogspot.com/2018/03/add-email-notification-in-azure-data.html
I have tried searching up many tutorials, guides and the official docs as well. However, all of them have some templates already there in the Logic Apps Designer. I cannot find the templates and the 'When a HTTP request is received' trigger is also not available in the drop-down.
Please let me know how to proceed.
EDIT :
If you start with a blank Logic App, search for 'HTTP' or 'Request' and select Request.
On the next screen under triggers, select "When a HTTP request is received" and you should be good to go.
EDIT:
It looks like you created a Standard Logic App, which works in a slightly different way. For instance it can contain multiple workflows, which means you create workflows yourself. In the Consumption model, there's one workflow withing a Logic App, so you can open up the editor for that one directly. If there's no explicit reason for you to use Standard, a Consumption Logic App will be easier to work with.
If you really need a Standard Logic App, go to 'Workflows' and create a new workflow:
Then click the newly created workflow to edit it, go to 'Designer' and search for 'HTTP' to add an HTTP trigger:
Here's some information on the Consumption model for Logic Apps:
Resource type
Benefits
Resource sharing and usage
Limits management
Logic App (Consumption) Host environment: Multi-tenant Azure Logic Apps
- Easiest to get started - Pay-for-what-you-use - Fully managed
A single logic app can have only one workflow. Logic apps created by customers across multiple tenants share the same processing (compute), storage, network, and so on.
Azure Logic Apps manages the default values for these limits, but you can change some of these values, if that option exists for a specific limit.
See Resource type and host environment differences for a comparison with the other hosting options.
I was able to solve this. I wasn't able to view a few functionalities because of another error : Functions runtime error Microsoft.WindowsAzure.Storage: Value cannot be null. (Parameter 'connectionString').
AzureWebJobsStorage App Setting was missing which caused the error. I added that and now I can see the triggers and other stuff.
Thanks #rickvdbosch
I'm migrating extensive SharePoint application to Azure and I'm looking for a recommendation in terms of replacing Timer Jobs with some Azure service. Which one would be most suitable? Azure Functions, Azure Logic Apps? The timer job needs to connect to a web service and make some GET / POST calls. Maybe sending e-mails.
What would you recommend? Any pros / cons?
Thanks,
George
With that additional context, but without a full understanding of the logic you need to implement around the calls, I'd suggest you look into a combination of a Logic App and a Function. The Logic App will make the time trigger and any email jobs more configurable, but the Function will give you more control of your web requests and logic, especially if those are more complex than simply making a request and ensuring it succeeded.
Set up the Logic App on a time trigger, and use it to orchestrate the Function and any email jobs. You can use the Logic App HTTP connector to trigger an HTTP-based Function, or you can look at the Function App connector.
For the Function, write it in C# and reuse your code there. Add any other calls and handling logic you require, then return a response for the Logic App to consume.
Add Control and Email (there are several of these for different email providers) connectors to the Logic App to send out relevant emails per the Function app result.
I have a scenario wherein I want to invoke the logic app as API (probably HTTP trigger) and at the same time, I would like to invoke the logic in recurrent fashion as well (probably using recurrence trigger). Since there can only be one starting trigger in the logic app, how can I solve this problem?
Logic apps can only have one trigger.
Consider a second logic app which is recurrence based and calls the http triggered logic app. There is a built in connector for logic apps to call other logic apps.
Your Logic App can have up to 10 triggers. Per the documentation on the Logic Apps schema definition:
The definitions for one or more triggers that instantiate your workflow. You can define more than one trigger, but only with the Workflow Definition Language, not visually through the Logic Apps Designer.
See: Schema reference for Workflow Definition Language in Azure Logic Apps
For this, the general pattern would be to use 3 Logic Apps.
One containing all the processing logic and flow.
Then as many Trigger Logic Apps as your situation requires, 2 as described. The Trigger Logic Apps simply call the processing Logic App.
How do I change the Azure Logic App Frequency and Request type (Not programmatic ally)
Frequncy and Request type
Thank you for providing a screenshot! So the REQUEST and FREQUENCY info that you're seeing on the Overview section relate to the specific Trigger that you're using in your Logic App. Different triggers will show different info here depending on how they're designed to operate & work.
In your case, it looks like you're using one of Logic Apps' built-in connector called Request which will trigger workflow in your Logic Apps whenever a request is received to its endpoint hence manual and on-demand.
To change this trigger, navigate to Logic Apps Designer view under DEVELOPMENT TOOLS in the Azure Portal as shown below:
Moreover, I recommend reading Logic Apps' documentation here and finding more about triggers and actions; overall concepts behand Logic Apps. Hope this helps and goodluck with your journey on Logic Apps!
I have looked through documentation for WebJobs, Functions and Logic Apps in Azure but I cannot find a way to schedule a one-time execution of a process through code. My users need to be able to schedule notifications to go out at a specific time in the future (usually within a few hours or a day from being scheduled). Everything I am reading on those processes is using CRON expressions which is not designed for one-time executions. I realize that I could schedule the job to run on intervals and check the database to see if the rest of the job needs to run, but I would like to avoid running the jobs unnecessarily if possible. Any help is appreciated.
If it is relevant, I am using C#, ASP.NET MVC Core, App Services and a SQL database all hosted in Azure. My plan was to use Logic apps to check the database for a scheduled event and send notifications through Twilio, SendGrid, and iOS/Android push notifications.
One option is to create Azure Service Bus Messages in your App using the ScheduledEnqueueTimeUtc property. This will create the message in the queue, but will only be consumable at that time.
Then a Logic App could be listening to that Service Bus Queue and doing the further processing, e.g. SendGrid, Twilio, etc...
HTH
You could use Azure Queue trigger with deferred visibility. This will keep the message invisible for a specified timeout. This conveniently acts as a timer.
CloudQueue queueOutput; // same queue as trigger listens on
var strjson = JsonConvert.SerializeObject(message); // message is your payload
var cloudMsg = new CloudQueueMessage(strjson);
var delay = TimeSpan.FromHours(1);
queueOutput.AddMessage(cloudMsg, initialVisibilityDelay: delay);
See https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.storage.queue.cloudqueue.addmessage?view=azure-dotnet for more details on this overload of AddMessage.
You can use Azure Automation to schedule tasks programmatically using REST API. Learn about it here.
You can use Azure Event Grid also. Based on this article you can “Extend existing workflows by triggering a Logic App once there is a new record in your database".
Hope this helps.
The other answers are all valid options, but there are some others as well.
For Logic Apps you can build this behavior into the app as described in the Scheduler migration guide. The solution described there is to create a logic app with a http trigger, and pass the desired execution time to that trigger (in post data or query parameters). The 'Delay Until' block can then be used to postpone the execution of the following steps to the time passed to the trigger.
You'd have to change the logic app to support this, but depending on the use case that may not be an issue.
For Azure functions a similar pattern could be achieved using Durable Functions which has support for Timers.