Azure Logic Apps
- 1 Intro
- 2 Documentation
- 3 Tips and Tidbits
- 4 Access On-Prem Resources
- 5 Logic Apps and Azure Functions
- 6 Creating A Logic App In Portal
- 7 IoT remote monitoring and notifications with Azure Logic Apps connecting your IoT hub and mailbox
- 8 B2B enterprise integration workflows with Azure Logic Apps and Enterprise Integration Pack
- 9 Install on-premises data gateway for Azure Logic Apps
- 10 Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps
- 11 Reference guide to expression functions for Azure Logic Apps and Power Automate
- 12 Create, edit, or extend JSON for logic app workflow definitions in Azure Logic Apps
- 13 Logic Apps In An Isolated Service Environment (ISE)
- 14 Troubleshoot and diagnose workflow failures in Azure Logic Apps
- 15 Handle errors and exceptions in Azure Logic Apps
- 16 Azure Container Registry as an Event Grid source
Intro
Azure Logic Apps is a cloud-based platform for creating and running automated workflows that integrate your apps, data, services, and systems. With this platform, you can quickly develop highly scalable integration solutions for your enterprise and business-to-business (B2B) scenarios.
Documentation
Tips and Tidbits
A connector is a component that provides an interface to an external service. For example, the Twitter connector allows you to send and retrieve tweets,
A connector uses the external service's REST or SOAP API to do its work. When you use a connector in your Logic App, the connector calls the service's underlying API for you.
To securely access and run operations in real time on various data sources, you can choose managed connectors from a 400+ and growing Azure connectors ecosystem to use in your workflows, for example:
Azure services such as Blob Storage and Service Bus
Office 365 services such as Outlook, Excel, and SharePoint
Database servers such as SQL and Oracle
Enterprise systems such as SAP and IBM MQ
File shares such as FTP and SFTP
You can write custom connectors to access services that don't have pre-built connectors. The services must have a REST or SOAP API.
To create a custom connector, you first generate an OpenAPI or Postman description of the API. You then use that API description to create a Custom Connector resource in the Azure portal.
You build a Logic App from triggers and actions. An app must begin with a trigger. After the trigger, you include as many actions as you need to implement your workflow.
Access On-Prem Resources
Before you can access data sources on premises from your logic apps, you have to:
Install the on-premises data gateway on a local computer
Create a gateway resource in Azure for your gateway installation.
You can then select this gateway resource in the triggers and actions that you want to use for the on-premises connectors available in Azure Logic Apps.
Azure Logic Apps supports read and write operations through the data gateway. However, these operations have limits on their payload size.
Logic Apps and Azure Functions
Create and run your own code from workflows in Azure Logic Apps by using Azure Functions
When you want to run code that performs a specific job in your logic app workflow, you can create a function by using Azure Functions.
This service helps you create Node.js, C#, and F# functions so you don't have to build a complete app or infrastructure to run code.
Creating A Logic App In Portal
IoT remote monitoring and notifications with Azure Logic Apps connecting your IoT hub and mailbox
IoT remote monitoring and notifications with Azure Logic Apps connecting your IoT hub and mailbox <== DOTHIS
Complete the Raspberry Pi online simulator tutorial or one of the device tutorials.
A logic app begins with a trigger, which is then followed by one or more actions that can be sequenced using built-in controls, such as conditions and iterators.
The arrival of telemetry data from a device at an IoT Hub endpoint can initiate logic app workflows to warehouse the data in an Azure Storage blob, send email alerts to warn of data anomalies, schedule a technician visit if a device reports a failure, and so on.
Under Triggers, select When one or more messages arrive in a queue (auto-complete).
Configure the logic app action
Choose an action, select the All tab.
Type
smtp
in the search box, select the SMTP service in the search result, and then select Send Email.
B2B enterprise integration workflows with Azure Logic Apps and Enterprise Integration Pack
B2B enterprise integration workflows with Azure Logic Apps and Enterprise Integration Pack
For business-to-business (B2B) solutions and seamless communication between organizations, you can build automated, scalable, enterprise integration workflows by using Azure Logic Apps with the Enterprise Integration Pack (EIP).
EIP is architecturally based on integration accounts.
These accounts are cloud-based containers in Azure that simplify how you store, manage, and use B2B artifacts for B2B communication, including trading partners, agreements, maps, schemas, certificates, and so on.
The following diagram shows the high-level steps to start building B2B logic app workflows:
Install on-premises data gateway for Azure Logic Apps
Before you can connect to on-premises data sources from Azure Logic Apps, download and install the on-premises data gateway on a local computer.
The gateway works as a bridge that provides quick data transfer and encryption between data sources on premises and your logic apps
Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps
Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps
To get richer debugging information about your logic apps during runtime, you can set up and use Azure Monitor logs to record and store information about runtime data and events, such as trigger events, run events, and action events in a Log Analytics workspace.
To set up logging for your logic app, you can enable Log Analytics when you create your logic app, or you can install the Logic Apps Management solution in your Log Analytics workspace for existing logic apps.
If you turned on Log Analytics when you created your logic app, you already have the Logic Apps Management solution installed in your Log Analytics workspace.
On your logic app menu, under Monitoring, select Diagnostic settings > Add diagnostic setting.
Reference guide to expression functions for Azure Logic Apps and Power Automate
Reference guide to expression functions for Azure Logic Apps and Power Automate
ticks: Returns the number of ticks, which are 100-nanosecond intervals, since January 1, 0001 12:00:00 midnight (or DateTime.Ticks in C#) up to the specified timestamp.
ticks('<timestamp>')
utcNow: Return the current timestamp.
addDays: Add a number of days to a timestamp.
<days> The positive or negative number of days to add.
addDays('<timestamp>', <days>, '<format>'?)
TierAgeInDays=-180
addDays(utcNow(), variables("TierAgeInDays"))
Create, edit, or extend JSON for logic app workflow definitions in Azure Logic Apps
Create, edit, or extend JSON for logic app workflow definitions in Azure Logic Apps
When you create enterprise integration solutions with automated workflows in Azure Logic Apps, the underlying logic app definitions use simple and declarative JavaScript Object Notation (JSON) along with the Workflow Definition Language (WDL) schema for their description and validation.
These formats make logic app definitions easier to read and understand without knowing much about code.
When you want to automate creating and deploying logic apps, you can include logic app definitions as Azure resources inside Azure Resource Manager templates.
To work with logic app definitions in JSON, open the Code View editor when working in the Azure portal or in Visual Studio
Logic Apps In An Isolated Service Environment (ISE)
Announcing Azure Integration Service Environment for Logic Apps
An Integration Service Environment is a fully isolated and dedicated environment for all enterprise-scale integration needs.
When you create a new Integration Service Environment, it is injected into your Azure virtual network, which allows you to deploy Logic Apps as a service on your VNET.
Direct, secure access to your virtual network resources.
Enables Logic Apps to have secure, direct access to private resources, such as virtual machines, servers, and other services in your virtual network including Azure services with service endpoints and on-premises resources via an Express Route or site to site VPN.
Consistent, highly reliable performance. Eliminates the noisy neighbor issue, removing fear of intermittent slowdowns that can impact business critical processes with a dedicated runtime where only your Logic Apps execute in.
Isolated, private storage. Sensitive data subject to regulation is kept private and secure, opening new integration opportunities.
Predicable pricing. Provides a fixed monthly cost for Logic Apps. Each Integration Service Environment includes the free usage of 1 Standard Integration Account and 1 Enterprise connector.
If your Logic Apps action execution count exceeds 50 million action executions per month, the Integration Service Environment could provide better value.
Troubleshoot and diagnose workflow failures in Azure Logic Apps
Troubleshoot and diagnose workflow failures in Azure Logic Apps
Each logic app run starts with a trigger attempt, so if the trigger doesn't fire, follow these steps:
Check the trigger's status by checking the trigger history.
Check the trigger's inputs to confirm that they appear as you expect.
Check the triggers outputs, if any, to confirm that they appear as you expect.
Each time that the trigger fires for an item or event, the Logic Apps engine creates and runs a separate workflow instance for each item or event.
If a run fails, follow these steps to review what happened during that run, including the status for each step in the workflow plus the inputs and outputs for each step.
Check the workflow's run status by checking the runs history.
Check the failed step's inputs to confirm whether they appear as you expect.
Handle errors and exceptions in Azure Logic Apps
For the most basic exception and error handling, you can use a retry policy in any action or trigger where supported, for example, see HTTP action.
Here are the retry policy types:
Type | Description |
---|---|
Default | This policy sends up to four retries at exponentially increasing intervals, which scale by 7.5 seconds but are capped between 5 and 45 seconds. |
Exponential interval | This policy waits a random interval selected from an exponentially growing range before sending the next request. |
Fixed interval | This policy waits the specified interval before sending the next request. |
None | Don't resend the request. |
The retry interval where the value must use ISO 8601 format.
The default minimum interval is
PT5S
and the maximum interval isPT1D
.When you use the exponential interval policy, you can specify different minimum and maximum values.
Azure Container Registry as an Event Grid source
Azure Container Registry as an Event Grid source
The following example shows the schema of an image pushed event:
[{ "id": "831e1650-001e-001b-66ab-eeb76e069631", "topic": "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.ContainerRegistry/registries/<name>", "subject": "aci-helloworld:v1", "eventType": "ImagePushed", "eventTime": "2018-04-25T21:39:47.6549614Z", "data": { "id": "31c51664-e5bd-416a-a5df-e5206bc47ed0", "timestamp": "2018-04-25T21:39:47.276585742Z", "action": "push", "target": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 3023, "digest": "sha256:213bbc182920ab41e18edc2001e06abcca6735d87782d9cef68abd83941cf0e5", "length": 3023, "repository": "aci-helloworld", "tag": "v1" }, "request": { "id": "7c66f28b-de19-40a4-821c-6f5f6c0003a4", "host": "demo.azurecr.io", "method": "PUT", "useragent": "docker/18.03.0-ce go/go1.9.4 git-commit/0520e24 os/windows arch/amd64 UpstreamClient(Docker-Client/18.03.0-ce \\\\(windows\\\\))" } }, "dataVersion": "1.0", "metadataVersion": "1" }]