Develop an App Service Logic App

Develop an App Service Logic App is part of Connect to and consume Azure services and third-party services topics. the total weight of this in the exam will be 25-30%. This training post is designed to help and provide readers with a better understanding of the topic mentioned.

Disclaimer: This is not a training article to help complete the Microsoft Azure AZ-204, but it provides a good insight and understanding of topics and subject matters within the specified. labs and hands-on work are essential to passing most Microsoft Azure exams.

Develop an App Service Logic App:
Logic Apps Overview

Develop an App Service Logic App:

Azure logic apps

logic apps helps you build solutions that integrate apps, data, systems, and services across enterprises or organizations by automating tasks and business processes as workflows. logic apps is cloud service in Azure that simplifies how you design and create scalable solutions for app integration, data integration, system integration, enterprise application integration (EAI), and B2B communication, whether in the cloud, on premises, or both.

For example, here are just a few workloads that you can automate with logic apps:

  • Process and route orders across on-premises systems and cloud services.
  • Move uploaded files from an SFTP or FTP server to Azure Storage.
  • Send email notifications with Office 365 when events happen in various systems, apps, and services.
  • Monitor tweets for a specific subject, analyze the sentiment, and create alerts or tasks for items that need review.

Components

Workflow

The business process described as a series of steps

Triggers

The step that invokes a new workflow instance

Actions

A individual step in a workflow, typically a Connector or custom API app

Connectors

A special case of an API app that is prebuilt and ready to integrate with a specific service or data source. For example:

Twitter and SQL Server Connectors

Workflow components

Logic apps are composed of a workflow that consists of at-least one trigger followed by a series of actions or connectors to perform specific tasks.

Develop an App Service Logic App:
create a Logic App

Develop an App Service Logic App:

Create logic apps by using Visual Studio

With Azure logic apps and Visual Studio, you can create workflows for automating tasks and processes that integrate apps, data, systems, and services across enterprises and organizations. This lesson shows how you can design and build these workflows by creating logic apps in Visual Studio and deploying those apps to Azure in the cloud. And although you can perform these tasks in the Azure portal, Visual Studio lets you add logic apps to source control, publish different versions, and create Azure Resource Manager templates for different deployment environments.

logic apps Designer

You can build your logic apps visually with the logic apps Designer, available in the Azure portal through your browser and in Visual Studio. For more custom logic apps, you can create or edit logic app definitions in JavaScript Object Notation (JSON) by working in “code view” mode. You can also use Azure PowerShell commands and Azure Resource Manager templates for select tasks. Logic apps deploy and run in the cloud on Azure.

logic apps Designer – action search

When you first decide to create an action, you must select an action from the list of available actions. A search bar makes it easier to find the specific action and connector you require.

logic apps Designer – action configuration

After an action is selected, you will use the designer to configure the action. The configuration screen will be unique to each action.

logic apps Designer – dynamic content

A side panel makes it easier to add expressions that reference variables, input, and output from other locations in the workflow. In this example, an output of the previous trigger or action is used in the current action.

Schedule triggers

You can start your logic app workflow by using a scheduled trigger, which isn’t associated with any specific service or system.

This type of trigger starts and runs your workflow based on the recurrence frequency and interval that you specify. You can also set the start date and time as well as the time zone. Each time a trigger fires, logic apps creates and runs a new workflow instance for your logic app.

Develop an App Service Logic App:
create a custom connector for Logic Apps

Develop an App Service Logic App

Connectors

Built-ins: These built-in actions and triggers help you create logic apps that run on custom schedules, communicate with other endpoints, receive and respond to requests, and call Azure functions, Azure API Apps (Web Apps), your own APIs managed and published with Azure API Management, and nested logic apps that can receive requests. You can also use built-in actions that help you organize and control your logic app’s workflow, and also work with data.

Managed connectors: These connectors provide triggers and actions for accessing other services and systems. Some connectors require that you first create connections that are managed by logic apps. Managed connectors are organized into these groups:

Managed API connectors

Create logic apps that use services such as Azure Blob storage, Office 365, Dynamics, Power BI, OneDrive, Salesforce, SharePoint Online, and many more.

On-premises connectors

After you install and set up the on-premises data gateway, these connectors help your logic apps access on-premises systems such as SQL Server, SharePoint Server, Oracle DB, file shares, and others.

Integration account connectors

Available when you create and pay for an integration account, these connectors transform and validate XML, encode and decode flat files, and process B2B messages with AS2, EDIFACT, and X12 protocols.

Enterprise connectors

Provide access to enterprise systems such as SAP and IBM MQ for an additional cost.

Connector components

Connectors are composed of

  • Actions
    • Changes directed by a user
  • Triggers
    • Notify your app when events occur

There are two types of Triggers

  • Polling triggers
  • Push triggers

Custom connectors

Without writing any code, you can build workflows and apps with Azure logic apps, Microsoft Flow, and PowerApps. To help you integrate your data and business processes, these services offer more than 180 connectors—for Microsoft services and products, and other services like GitHub, Salesforce, Twitter, and more.

Sometimes though, you might want to call APIs, services, and systems that aren’t available as prebuilt connectors. To support more tailored scenarios, you can build custom connectors with their own triggers and actions. These connectors are function-based—data is returned based on calling specific functions in the underlying service. 

The example diagram shows a custom connector for an API that detects sentiment in text.

Develop an App Service Logic App:
create a custom template for Logic Apps

Develop an App Service Logic App:

Deployment templates

After a logic app has been created, you might want to create it as an Azure Resource Manager template. This way, you can easily deploy the logic app to any environment or resource group where you might need it. 

A logic app has three basic components: •logic app resource: Contains information about things like pricing plan, location, and the workflow definition. •Workflow definition: Describes your logic app’s workflow steps and how the logic apps engine should execute the workflow. You can view this definition in your logic app’s Code View window. In the logic app resource, you can find this definition in the definition property. •Connections: Refers to separate resources that securely store metadata about any connector connections, such as a connection string and an access token. In the logic app resource, your logic app references these resources in the parameters section. •

You can view all these pieces of existing logic apps by using a tool like Azure Resource Explorer.

To make a template for a logic app to use with resource group deployments, you must define the resources and parameterize as needed. For example, if you’re deploying to a development, test, and production environment, you likely want to use different connection strings to a SQL database in each environment. Or, you might want to deploy within different subscriptions or resource groups.

Template code

In this code example, the parameters and triggers are shown for the workflow.

The parameters are the input values and the trigger is the event that starts the workflow. In this example, our workflow is triggered once every hour and starts off with a string parameter named testURI.

In this code example, the actions and outputs are shown for the workflow.

The actions object contains a list of actions that will execute for the workflow. In this example, a HTTP GET request is issued against the URL stored in the testUri parameter.

Create a deployment template – Azure PowerShell

The easiest way to install the module is via the PowerShell Gallery, by using the command Install-Module -Name LogicAppTemplate.

For the module to work with any tenant and subscription access token, we recommend that you use it with the ARMClient command-line tool.

After PowerShell is installed, you can generate a template by using the Get-LogicAppTemplate command.

$SubscriptionId is the Azure subscription ID. This line first gets an access token via ARMClient, then pipes it through to the PowerShell script, and then creates the template in a JSON file.

More topics on Connect to and consume Azure services and third-party services:

Implement API Management

Develop Event-Based solutions

Develop message-based solutions

Microsoft Azure AZ-204 exam topics:

If you have covered the current topics in Connect to and consume Azure services and third-party services then you can have a look at the other topic areas:

View full documentation Microsoft Azure: AZ-204 exam content from Microsoft

Leave a Reply