- PREAMBLE
In this blog, we will take a review of Azure serverless services with the intent of understanding its components and methodology. We will go further by examining the major difference between two core Azure's serverless services of Function App and Logic App. Then conclude by creating a Logic app workflow in Azure and document our steps in a repository in GitHub.
WHAT IS AZURE SERVERLESS?
Azure Serverless is a cloud computing model provided by Microsoft Azure that allows you to build and run applications without managing the underlying infrastructure. With Azure Serverless, you can focus on writing code and developing your application logic without worrying about server provisioning, scaling, or maintenance.
Azure provides several serverless services that enable you to build scalable and event-driven applications. Some key serverless services in Azure include:
Azure Functions App: Azure Functions is a serverless compute service that allows you to write code in various programming languages, such as C#, Java, Python, and JavaScript, and execute these codes in response to events or triggers. Functions can be used for various scenarios like data processing and automation.
There is also Azure Durable Functions which is an extension of Azure Functions that allows you to write stateful workflows and coordination logic using an orchestrator pattern. It helps in building long-running, scalable, and reliable serverless applications.
Azure Logic Apps: Azure Logic Apps is a serverless workflow orchestration service that helps you build business process automation and integrate systems, services, and applications together. It provides a visual designer to create workflows by connecting pre-built connectors and triggers.
Azure Event Grid: Azure Event Grid is an event routing service that simplifies the development of event-based applications. It can route events from various Azure services and custom sources to subscribers, which can be Azure Functions, Logic Apps, webhooks, or any other HTTP endpoint.
Azure App Service: Azure App Service is a fully managed platform for building and hosting web applications. It supports multiple programming languages and frameworks and provides built-in DevOps capabilities. App Service offers both serverless and dedicated compute options, allowing you to choose based on your application's needs.
Summary
Azure Serverless services provide automatic scaling, pay-per-use pricing models, built-in integration with other Azure services, and easy deployment and management through Azure Portal, CLI, or other development tools. These services enable developers to focus on writing code and delivering value without worrying about the underlying infrastructure.
DIFFERENCE BETWEEN AZURE FUNCTION APP AND AZURE LOGIC APP
Azure Function app and Azure Logic app are both serverless services provided by Microsoft Azure, but their difference is in the purposes they serve and their capabilities.
Here is a breakdown of the key differences between the two
1. Compute vs Workflow Orchestration: While Azure Function app is primarily focused on compute, where it allows you to write code (functions) in various programming languages and execute them in response to events or triggers.
The Azure Logic app on the other hand focuses on workflow orchestration and integration of various systems, services, and applications.
2. Event-Driven Triggers: Both apps support event-driven triggers. However, Logic App triggers are often tied to external events, such as receiving an email, receiving a message from a service bus, or monitoring a specific folder in a storage account.
3. Stateful vs Stateless: While Azure Logic Apps are designed to support long-running and stateful workflows. Azure Function Apps on the other hand are stateless by default.
4. Developer focused vs Networking focused: Azure Functions are designed to empower developers to write and deploy codes quickly. Logic Apps offer a wide range of connectors that allow you to interact with various services and systems, both within Azure and outside Azure network.
CREATING A CONSUMPTION WORKFLOW IN AZURE LOGIC APP
Here, we will be creating a consumption workflow in multi-tenant Azure Logic Apps with the Azure portal.
Steps
- Create a Consumption logic app resource that's hosted in multi-tenant Azure Logic Apps.
- Select the blank logic app workflow template.
- Add a trigger that specifies when to run the workflow.
- Add an action that performs a task after the trigger fires.
- Run your workflow.
Prerequisites
An Azure account and subscription.
An email account from a service that works with Azure Logic Apps, such as Office 365 Outlook or Outlook.com.
Step 1 Create a Consumption logic app resource
Sign into Azure portal using this URL
https://portal.azure.com/
Type and select logic app in the search bar at the top of the page.
- On the Logic apps page and toolbar, select Add.
- On the Create Logic App pane, choose your logic app resource's plan type first. That way, only the options for that plan type appear.
- Then provide Azure subscription name, Resource Group, Logic App name, Region and select No for Enable log analytics
- Click Review + Create.
- On the validation page that appears, confirm all the information that you provided, and select Create.
Step 2 Select the blank logic app workflow template
- After Azure successfully deploys your logic app resource, select Go to resource.
Scroll down past the video and the section named Start with a common trigger.
Under Templates, select Blank Logic App.
- In the designer, under the search box, select All. In the search box, enter rss.
- In the trigger, provide the following information: The RSS feed URL, Publish Date, How often do you want to check for items? and Frequency.
For this purpose of this article, we are using the Fox News Network's RSS feed bellow.
href="https://www.foxnews.com/story/foxnews-com-rss-feeds">
- Minimize the trigger.
- Then save your workflow, by going to the designer toolbar and click on Save. This step instantly publishes your logic app workflow live in the Azure portal. However, the trigger only checks the RSS feed without taking any other actions. So, you need to add an action to specify what you want to happen when the trigger fires.
Step 3: Add an action
Following a trigger, an action is any subsequent step that runs some operation in the workflow. Any action can use the outputs from the previous step, which can be the trigger or another action. You can choose from many different actions, include multiple actions up to the limit per workflow, and even create different action paths.
- Under the When a feed item is published trigger, select New step.
Under the Choose an operation search box, select All.
In the search box, enter send an email. To filter the Actions list to a specific app or service, select the icon for that app or service first.
For this exercise, we selected Outlook.com.
You can now more easily find and select the action that you want. Here, we are selecting Send an email.
- If your selected email service prompts you to sign in and authenticate your identity, complete that step now.
- Choose an email address.
- Click on the Accept button.
- From the Add dynamic content list, under When a feed item is published, select Feed title.
The feed title is a trigger output that references the title for the RSS item. Your email uses this output to show the RSS item's title.
- In the dynamic content list, if no outputs appear from the When a feed item is published trigger, next to the action's header, select See more.
- In the Body box, enter email body content. For this article, the body includes the following properties, descriptive text for each property. To add blank lines in an edit box, press Shift + Enter.
When you're done, the email subject looks like the following.
Save your workflow. On the designer toolbar, select Save.
Step 4: Run your workflow
To check that the workflow runs correctly, we can wait for the trigger to check the RSS feed based on the specified schedule. Or we can manually run the workflow from the designer toolbar.
Let us run the workflow manually.
Click on Run Trigger on the tool bar menu, then select Run.
If the RSS feed has new items, your workflow sends an email for each new item. Otherwise, your workflow waits until the next interval to check the RSS feed again.
- A successful manual run.
- Screenshot of an email from the workflow.
Step 5: Troubleshoot problems
Check your email account's junk or spam folder, in case the message was incorrectly filtered.
Make sure the RSS feed you're using has published items since the last scheduled or manual check.
Checking the Logic App for activity from Azure portal
- Go to Overview on your logic app by clicking on it.
- You can also check activities on your app by clicking on Resource group to display activities that has taken place within it.
Step 6: Clean up resources
Whenever you provisioned resources for learning purpose on any cloud platform, the best practice is to delete as soon as possible. We do this here by deleting the resource group.
- In the Azure search box, enter resource groups, and select Resource groups.
- Find and select your logic app's resource group. On the Overview pane, select Delete resource group.
- When the confirmation pane appears, enter the resource group name, and select Delete.
Hope this article help you understand Azure serverless services and an indept knowledge on the Logic App service.
Thank you for your time. Please subscribe and follow my page for more blogs of this nature
Top comments (0)