- Article
- 14 minutes to read
Applies to:Azure Logic Apps (Verbraucher)
This tutorial shows how to create an example.Logik-App-Workflowwhich runs on a recurring schedule. Specifically, this example workflow checks the travel time, including traffic, between two locations and runs every weekday morning. If the time exceeds a certain threshold, the workflow will send you an email with the travel time and the additional time it takes to reach your destination. The workflow consists of several steps, starting with a script-based trigger, followed by a Bing Maps action, a data operation action, a control flow action, and an email notification action.
In this tutorial you will learn how to:
- Create an empty logic app and workflow.
- Add a recursion trigger that specifies the schedule to run your workflow.
- Add a Bing Maps action that gets the travel time for a route.
- Add an action that creates a variable, converts the drive time from seconds to minutes, and stores the result in the variable.
- Add a condition that compares travel time to a specified threshold.
- Add an action that sends an email when the travel time exceeds the limit.
When you're done, your workflow will look like the following high-level example:
previous requirements
An Azure account and subscription. If you don't have a subscription,Sign up for a free Azure account.
An email account from an email provider supported by Azure Logic Apps, e.g. E.g. Office 365 Outlook, Outlook.com or Gmail. With other providersCheck the list of connectors here. This quickstart uses Office 365 Outlook with a work or school account. If you're using a different email account, the general steps remain the same, but your interface may be slightly different.
Important
If you choose to use the Gmail connector, only G Suite business accounts can use this connector in logic app workflows without restrictions. If you have a personal Gmail account, you can only use this connector with certain Google-approved services, or you canCreate a Google client app to authenticate with your Gmail connector.For more information, seeData security and privacy policies for Google Connectors in Azure Logic Apps.
To get the travel time for a route, you need a master key for the Bing Maps API. To get this key follow the steps forHow to get a Bing Maps key.
If your workflow needs to communicate through a firewall that restricts traffic to specific IP addresses, that firewall needs to allow access to itbothIsVerbotenjoutgoingIP addresses used by Azure Logic Apps in the Azure region where your logic app resource resides. If your workflow also usesmanaged connectors, such as Office 365 Outlook Connector or SQL Connector, or usecustom connectors, the firewall must also allow accessatIsOutbound IP addresses of the managed connectorin the Azure region of your logic app resource.
Create a consuming logic app workflow
NOblue portal, sign in with your Azure account.
Select on the Azure home pagecreate a resource.
No menu for Azure Marketplace, selectIntegration>logical application.
About itCreate logic appTafel, anThe essentialprovide the following information about your logic app resource.
Property Mandatory Valentina Description enrollment Sim <Name of Azure-Subscriptions> Your Azure subscription name. This example usesPay when you go out. resource group Sim LA-TravelTime-RG IsAzure resource groupwhere you create your logic app resource and associated resources. This name must be unique across all regions and can only contain letters, numbers, hyphens ( -
), underlines (_
), brackets ((
,)
) and periods (.
).Name Sim LA - travel time Your logic app's resource name, which must be unique across all regions and contain only letters, numbers, dashes ( -
), underlines (_
), brackets ((
,)
) and periods (.
).Before making any other selections, go toPlanoSection. Forplanttype, chooseconsumptionto show only the settings for a Consume Logic App workflow running in multi-tenant Azure Logic Apps.
IsplanttypeThe property also specifies the billing model to use.
planttype Description Standard This logic app type is the default choice and runs on single-tenant Azure Logic Apps and uses theStandard billing model. consumption This type of logic app runs on global multi-tenant Azure Logic Apps and uses theconsumption billing model. Now proceed with the following selection:
Property Mandatory Valentina Description Region Sim western United States The Azure data center region to store your application's information. This sample deploys the sample logic appwestern United StatesRegion in Azure. Use: If your subscription is associated with an Integration Service environment, this list includes those environments.
Enable log analysis Sim NO This option only appears and applies when you selectconsumptionlogic app type. Change this option only if you want to enable diagnostic logging. For this tutorial, keep the default selection. When you're done, selectrevise + create. After Azure validates information about your logic app resource, selectCreate.
(Video) Azure Logic Apps -1 | Introduction | Create first Logic App | Step by Step Guide | Business WorkFlowAfter Azure deploys your app, choosego to the resource.
Azure opens the workflow template selector panel, showing an introductory video, commonly used triggers, and workflow template samples.
Scroll down past the "Video" and "Common Triggers" sections to "modelssection and selectblank logic app.
Then add the repeatDeduction, which runs the workflow based on a specific schedule. Every workflow should begin with a trigger that fires when a specific event occurs or when new data meets a specific condition. For more information, seeCreate your first logic app workflow.
Add repeat trigger
In the workflow designer, select in the search boxBuilt-in.
Type in the search boxReappearand select the named triggerReappear.
About itReappearshape, choose thesuspension points(...) and then selectrename. Rename the trigger with this description:
Check the travel time every weekday morning
See AlsoQuickstart: Create an automated workflow with the Azure portal - Azure Logic AppsCustom Connectors - Azure Logic AppsQuickstart: Create and manage workflows with the Azure CLI - Azure Logic AppsCalls to service endpoints over HTTP or HTTPS - Azure Logic AppsIn the trigger, change these properties as described and shown here.
Property Mandatory Valentina Description Interval Sim 1 The number of wait intervals between checks. frequency Sim Week The unit of time to use for the repeat. LowIntervaljfrequency, open thisadd new parameterand select these properties to add them to the trigger.
- Nowadays
- at this time
- in these minutes
Now set the values for the additional properties as shown and described here.
Property Valentina Description Nowadays Monday Tuesday Wednesday Thursday Friday This setting is only available if you configure thefrequencyAWeek. at this time 7, 8, 9 This setting is only available if you configure thefrequencyAWeekÖTag. Select the hours of the day for this recurrence. This example continues 7
,8
, Of9
-Time stamp.in these minutes 0, 15, 30, 45 This setting is only available if you configure thefrequencyAWeekÖTag. For this replay, select the minutes of the day. This example starts at the zero hour mark and runs every 15 minutes. This trigger fires every 15 minutes every day of the week, starting at 7:00 AM. M. and ends at 9:45 a.m. M. HeAdvance paymentChart shows repeat timeline. For more information, seeScheduling tasks and workflowsjWorkflow actions and triggers.
To hide the trigger details for now, collapse the shape by clicking in the shape's title bar.
Save your workflow. Select on the designer toolbarSave on computer.
Your logic app's workflow is now active in the Azure portal, but does nothing other than being triggered on the specified schedule. So add an action that reacts when the trigger fires.
Get the travel time of a route
Now that you have a trigger, add oneactionwhich preserves the travel time between two locations. Azure Logic Apps provides a connector for the Bing Maps API so you can easily get this information. Before beginning this task, make sure you have a Bing Maps API key as described in the prerequisites of this tutorial.
In the workflow designer, select below the repeat triggernew step.
Lowchoose an operation, chooseStandard. Type in the search boxMaps from Bingand select the action invokedtake away.
If you don't have a Bing Maps connection, you'll be prompted to connect. Enter the connection details as shown and described, then selectCreate.
Property Mandatory Valentina Description connection name Sim BingMaps connection Enter a name for your connection. This example uses BingMaps connection
.API key Sim <Bing-Maps-API-Chave> Enter the Bing Maps API key you received earlier. If you don't have a Bing Maps key, find outhow do you get a key. Rename the action with this description:
Get route and travel time with traffic
.In action, open theAdd new parameter listand select these properties.
- optimize
- distance unit
- Travel mode
Now enter values for the properties shown and described here.
Property Mandatory Valentina Description landmark 1 Sim <Startort> The origin of your route. This example gives an example starting address. landmark 2 Sim <final location> The destination of your route. This example gives an example destination address. optimize NO timeWithTraffic A parameter to optimize your route, such as B. Distance, driving time in current traffic, etc. Select the parameter value,timeWithTraffic. distance unit NO <your preference> The distance unit for your route. This example usesMillaas a unit. Travel mode NO Drive The travel mode for your route. chooseDriveAway. For more information about these parameters and values, seecalculate a route.
Select on the designer toolbarSave on computer.
(Video) Custom Approval Workflows in Azure Logic App
Then create a variable so you can convert and store the current drive time in minutes instead of seconds. This way you avoid repeating the conversion and can more easily use the value in later steps.
Create a variable to store the travel time
Sometimes you might want to perform operations on data in your workflow and then use the results in subsequent actions. To store these results for easy reuse or reference, you can create variables that store these results after processing. You can only create variables at the top level of the workflow.
By default, thetake awayThe action returns the current travel time with traffic in secondstravel time trafficProperty. By converting and storing this value in minutes, you can more easily reuse the value later without having to convert it again.
Not a designer, sob otake awayaction, selectnew step.
Lowchoose an operation, chooseBuilt-in. Type in the search boxvariablesand select the action invokedInitialize variable.
Rename this action with this description:
Create a variable to store the travel time
Provide this information for your variable as shown in this table and in the steps below the table:
Property Mandatory Valentina Description Name Sim travel time The name of your variable. This example uses travel time
.Typ Sim at The data type for your variable Valentina NO An expression that converts the current drive time from seconds to minutes (see steps below this table). The initial value of your variable. To create the expression ofValentinaproperty click in the box to open the dynamic content list. If necessary, expand your browser until the dynamic list appears. Choose from the dynamic content listExpression, which displays the expression editor.
The dynamic content list displays the results of previous actions, which you can select as input for subsequent actions in your workflow. The dynamic content list includes an expression editor that you can use to select functions that perform operations on your expression. This expression editor is only available in the dynamic content list.
In the expression editor, enter this expression:
div(,60)
Within the expression, place the cursor between the left parentheses (() and the comma (,) and selectdynamic content.
From the dynamic content list, select the property valuetravel time traffic.
After the property value resolves to the expression, selectACCORDINGLY.
IsValentinaThe property now appears as shown here:
Save your workflow. Select on the designer toolbarSave on computer.
Then add a condition that checks if the current travel time is greater than a certain threshold.
Compare travel time to threshold
Under theCreate a variable to store the travel timeaction, selectnew step.
Lowchoose an operation, chooseBuilt-in. Type in the search boxillness. and select the invoked action from the list of actionsillness.
Rename the condition with this description:
If the travel time exceeds the limit
Create a condition that checks if thetravel timeThe property value exceeds the stated limit as described and shown here:
In the condition on the left side of the condition, click in thechoose a valueCrate.
In the displayed list of dynamic content undervariables, select the called propertytravel time.
In the middle comparison field, select the called operatoris bigger than.
On the right side of the condition on whichchoose a valueenter this limit:
15
When you're done, the condition will look like this example:
(Video) 06. Logic App | Create workflow in consumption based logic app
Save your workflow. Select on the designer toolbarSave on computer.
Then add the action to take when the travel time exceeds your limit.
Send email when limit is exceeded
Now add an action that will email you when travel time exceeds your limit. This email contains the current travel time and the additional time required to drive the specified route.
in the conditionsTRUEstore selectionadd an action.
Lowchoose an operation, chooseStandard. Type in the search boxSend e-mail. The list returns many results, so to help you filter the list, first select the email connector you want.
For example, if you have an Outlook email account, select the connector for your account type:
- Select for Azure work or school accountsOutlook macht Office 365.
- Select for personal Microsoft accountsOutlook.com.
This example continues by selecting Office 365 Outlook.
When the connector actions are displayed, select the action that sends the email, for example:
If you're not already connected, sign in and authenticate access to your email account when prompted.
Azure Logic Apps creates a connection with your email account.
Rename the action with this description:
Send email with travel time
For theAproperty, enter the email address of the recipient. You can use your email address for testing purposes.
For theThemeproperty, specify the subject of the email and paste ittravel timevariable by following these steps:
type the text
Current driving time (minutes):
with spaces on the right. Hold the cursor onThemeso that the dynamic content list remains open.In the dynamic content list, in thevariablestitle, selectSee morehence the named variabletravel timepop up
Use
The dynamic content list does not display them automaticallytravel timevariable because theThemeThe property expects a string value whiletravel timeis an integer value.
For theBodyproperty specify the content of the email body by doing the following:
type the text
Add additional travel time (minutes):
with spaces on the right. Hold the cursor onBodyso that the dynamic content list remains open.Choose from the dynamic content listExpression, which displays the expression editor.
Enter in the expression editorsub(,15)To calculate the number of minutes exceeding your limit:
Within the expression, place the cursor between the left parentheses (() and the comma (,) and selectdynamic content.
Lowvariables, choosetravel time.
Once the property resolves to the expression, selectACCORDINGLY.
(Video) Azure Logic Apps TutorialIsBodyThe property now appears as shown here:
Save your workflow. Select on the designer toolbarSave on computer.
Then test and run your workflow, which now looks like this example:
Run your workflow
To start your workflow manually, select in the designer toolbartrigger execution>Run.
If the current travel time falls below your threshold, your workflow does nothing and waits for the next interval before checking again.
If the current travel time exceeds your limit, you will receive an email with the current travel time and the number of minutes that have exceeded your limit. This is an example of the email your workflow will send:
Advice
If you do not receive emails, please check your email spam folder. Your spam filter can redirect this type of email. Otherwise, if you're not sure if your workflow ran successfully, check outFix errors in your workflow.
Congratulations, you've created and run a recurring workflow based on a schedule.
To create other workflows that use theReappearTrigger Check out these templates, which are available after you create a new logic app resource:
- Get reminders sent to you daily.
- Delete older Azure blobs.
- Add a message to an Azure storage queue.
clean resources
Your workflow will continue to run until you disable or delete the logic app feature. When you no longer need the example workflow, delete the resource group that contains the logic app resource and related resources.
In the Azure portal search box, enter the name of the resource group you created. From the results belowresource groups, select the resource group.
In this example, the resource group named was created
LA-TravelTime-RG
.Advice
If you see the resource group under on the Azure home pagecurrent functions, you can select the group on the home page.
Check this in the resource group menugeneral descriptionis selected. About itgeneral descriptionPanel toolbar, selectDelete resource group.
In the confirmation window that appears, enter the resource group name and selectExtinguish.
Next Steps
In this tutorial, you created a logic app workflow that examines traffic based on a specific schedule (weekday mornings) and takes an action (sends an email) when the travel time exceeds a specified threshold. Now learn how to create a workflow that sends mailing list requests for approval by integrating Azure services, Microsoft services, and other SaaS (Software-as-a-Service) applications.
Manage mailing list requests
Comment
Submit and view feedback
FAQs
How do you automate logic apps? ›
To set up an Azure Logic Apps Automation Task, we need to navigate to our Azure Resource. In this case it will be my virtual machine. Once we open the properties for our VM, we can scroll down in the left navigation and find our Automation Task. Click the link to continue.
Which logic apps use workflows to automate business processes? ›Azure Logic Apps is a serverless application that enables users to integrate applications and define workflows; the user can schedule or automate business processes and workflow.
How do I trigger ADF in logic app? ›- Create a logic app of your preference, for this blog, I am creating an HTTP trigger logic app.
- Now click on add step and search for Azure data factory.
- Select create pipeline run and fill in the required information.
- Trigger your logic app and let it finish the run. ...
- Hope this helps.
The three basic components of a workflow diagram are input, transformation, output. Every step within a workflow is assigned one of these statuses.
What is the difference between logic apps and power automate? ›The main difference between Power Automate and Logic Apps is that Power Automate is a Robotic Process Automation tool while Logic Apps is an Integration Platform as a Service. Both tools can be used to automate business processes, but they differ in terms of the scale and scope of automation possible.
What is the difference between Azure logic apps and workflow? ›Azure Functions is a serverless compute service, while Logic Apps represents a serverless workflow. In Azure Functions, the event triggers the code; in Logic Apps, the event triggers the workflow. Overall, Logic Apps enables serverless applications to automate and orchestrate business processes and workflows.
What are the disadvantages of Azure logic apps? ›Likes and dislikes about Azure Logic Apps
Slow and clunky designer/development experience. Confusing split of capability / lack of parity between Standard and Consumption SKUs. Quickly runs out of steam and becomes hard to manage when trying to implement complex workflows.
Logic Apps has far more triggers than Power Automate. Logic Apps can be triggered with an HTTP call from the internet, which means any application with internet access can trigger a logic app. Power Automate did not have an HTP trigger. Logic Apps have far more actions and connectors than Power Automate.
What is Azure logic app workflow? ›Azure Logic Apps is a cloud platform where you can create and run automated workflows with little to no code. By using the visual designer and selecting from prebuilt operations, you can quickly build a workflow that integrates and manages your apps, data, services, and systems.
What is an example of workflow automation? ›Workflow automation can promote task management by creating to-dos out of emails. For example, if someone sends you an email in Gmail, that email can then be repurposed into a task inside Basecamp — automatically, of course.
Can we call logic app from ADF? ›
Logic App workflow
The Webhook in Azure Data Factory is waiting for an immediate response (within 1 minute) to confirm receiving the trigger. To do this inside Logic App you need to create a response action with Status 202 and put it right after the HTTP trigger.
- Open the logic app workflow in the designer. On the designer toolbar, select Parameters. ...
- Make your edits, close the parameters pane, and save your logic app workflow.
- Schedule trigger: A trigger that invokes a pipeline on a wall-clock schedule.
- Tumbling window trigger: A trigger that operates on a periodic interval, while also retaining state.
- Event-based trigger: A trigger that responds to an event.
- Start small but start now.
- Identify stakeholders and document who does what and when.
- Create a workflow diagram.
- Implement the workflow using simple automation software.
- Test the workflow.
- Deploy the workflow and train users.
- Solicit feedback and iteratively improve.
- Analyze and optimize.
- Step 1: Receipt of Raw Footage. ...
- Step 2: Storage and Organization of Raw Footage. ...
- Step 3: Build the Rough Cut. ...
- Step 4: Receive Notes and Refine The Rough Cut Into a Final "Locked" Cut. ...
- Step 5: Visual Effects (VFX) ...
- Step 6: Sound Effects/Mixing.
Azure Functions uses code to perform an action whereas Azure Logic Apps use workflow triggered by an event. This is because Azure Functions is employed through the use of codes whereas Azure Logic Apps are built using a visual designer with a simpler definition language.
Is Azure logic apps same as Power Automate? ›Azure Logic Apps provide a user-friendly designer surface similar to Power Automate with the option to build complex integration solutions, utilise advanced development tools, DevOps and monitoring, if required.
What are the advantages of Azure logic apps? ›- Easy to define the workflow – User can easily define the workflow with triggers and actions with user-intuitive GUI.
- Support for Enterprise applications – Logic Apps support integration with Office 365, Twitter, Dropbox and more.
A single logic app can have multiple stateful and stateless workflows. Workflows in a single logic app and tenant share the same processing (compute), storage, network, and so on.
Is workflow same as pipeline? ›While pipelines focus on the end to end flow for items through a series of stages or tasks, workflows are focused on how an item can go through a series of status changes through its life time.
Is Microsoft discontinuing Azure? ›
We're retiring Azure VMs (classic) on September 1, 2023 - Azure Virtual Machines | Microsoft Learn. This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What is the primary use for Azure logic apps? ›Build powerful integration solutions for key enterprise scenarios. Azure Logic Apps is a leading integration platform as a service (iPaaS) built on a containerized runtime. Deploy and run Logic Apps anywhere to increase scale and portability while automating business-critical workflows anywhere.
How long can Azure logic app run? ›For Consumption logic app workflows, the same setting controls the maximum number of days that a workflow can run and for keeping run history in storage. In multi-tenant Azure Logic Apps, the 90-day default limit is the same as the maximum limit.
What is the difference between Azure logic apps and Azure automation? ›azure logic apps is for managing a workflow. Azure automation is for creating runbooks to automate tasks like deployment, updates using powershell scripts, python scripts. If you are referring to SQL agent jobs those are available only in Azure SQL Managed Instance.
What is the difference between PowerApps and Azure logic apps? ›Azure Logic Apps is a service used for application integration, building workflows etc. PowerApps are for building GUI applications. Almost everything can be called an application, or an app, therefore it's not reasonable to assume that all things called apps are similar in some way.
What is the difference between Azure automation and Power Automate? ›One difference between Azure Logic Apps and Power Automate is how they are licensed. Azure Logic Apps has the options of being billed at a consumption (what you use) or a fixed pricing model. Power Automate has traditionally been licensed in the per user model but Microsoft is now starting to offer per flow licensing.
What is workflow in Azure logic app? ›The Azure resource you create when you want to build a workflow. There are multiple logic app resource types that run in different environments. Workflow. A series of steps that defines a task, business process, or workload. Each workflow starts with a single trigger, after which you must add one or more actions.
What are the steps to create a workflow? ›- Step 1: Establish boundaries. The single most important thing to remember about workflows is that they need clearly defined beginnings and endings. ...
- Step 2: Identify components. ...
- Step 3: Organize the sequence. ...
- Step 4: Review handoffs. ...
- Step 5: Optimize your workflow.
Workflow in an Azure Logic App is a sequence of actions or processes defined in steps. The actions will perform the business operations when input is provided through the managed connectors. Every workflow will be initiated by the trigger being fired.
How do I create a custom workflow in Azure DevOps? ›- Choose the Azure DevOps logo to open Projects. Choose the project collection whose processes you want to customize, and then choose Collection Settings.
- Then, choose Process.
Which Microsoft application is used to create workflows? ›
With Microsoft Power Automate, you can create a flow for Microsoft Forms that performs one or more tasks automatically after it's triggered by an event.
What's the difference between pipeline and workflow? ›While pipelines focus on the end to end flow for items through a series of stages or tasks, workflows are focused on how an item can go through a series of status changes through its life time.
What is the difference between workflow and SOP? ›SOPs are typically built from the bottom up. They are often confusing and present a difficult way to follow workflows. Process maps are built top-down, beginning with business systems, business processes, task, and knowledge. Workflow is designed directly into the documentation.
How do you create automation and workflows? ›- Start small but start now.
- Identify stakeholders and document who does what and when.
- Create a workflow diagram.
- Implement the workflow using simple automation software.
- Test the workflow.
- Deploy the workflow and train users.
- Solicit feedback and iteratively improve.
- Analyze and optimize.
- Open the module that you want to create a new workflow for. ...
- Click Setup > [Module name] workflows.
- On the list page that appears, on the Action Pane, click New.
- On the Create workflow page, select the type of workflow to create, and then click Create workflow.