Azure Logic Apps is a low-code, cloud-based Platform-as-a-Service (PaaS) that allows you to automate and orchestrate workflows, business processes, and activities. It acts as an integration platform as a service (iPaaS) that helps connect various systems and applications, both in the cloud and on-premises. Logic Apps can be used to automate tasks like sending emails, managing file uploads, and routing orders across different systems.
Azure Logic Apps is especially useful for use cases and scenarios where you need to coordinate actions across multiple systems and services. To help you learn about the capabilities and patterns that Azure Logic Apps supports, this guide describes common starting points, examples, and scenarios.
The following examples describe only a sample of tasks, business processes, and workloads that you can automate with Azure Logic Apps.
- Schedule and send email notifications using Office 365 when a specific event happens, for example, a new file is uploaded.
- Route and process customer orders across on-premises systems and cloud services.
- Move uploaded files from an SFTP or FTP server to Azure Blob Storage.
- Monitor social media activity, analyze the sentiment, and create alerts or tasks for items that need review.
When you build workflows with Azure Logic Apps, you usually don't have to write any code. However, if you have to create and run your own code, Azure Logic Apps supports this capability. For example, in workflows that run in multitenant Azure Logic Apps, you can write and run JavaScript code snippets directly within your workflow. For more complex and structured code, you can create and call functions from your workflows when you use the Azure Functions platform. For workflows that run in single-tenant Azure Logic Apps, App Service Environment (ASE) v3, or partially connected environments, you can write and run JavaScript code snippets, .NET code, C# scripts, and PowerShell scripts directly within your workflow.
Azure Logic Apps is fully managed by Microsoft Azure, which frees you from worrying about hosting, scaling, managing, monitoring, and maintaining solutions built with these services. When you use these capabilities to create "serverless" apps and solutions, you can focus more on building the business logic and functionality. Serverless platforms automatically scale to meet your needs, make integrations work faster, and help you build robust cloud apps using little to no code.
In Continuous to earlier article on Azure Function and Azure SQL, we are extending our scenario where we are designing the Azure Logic App to implement a workflow to execute simultaneously as we operate on Azure SQL.
Here we are designing the workflow that trigger every time when a new entry gets add in Azure SQL Database and based on the data value it executes the respective series of actions by itself.
Open Azure Portal and look for Azure Logic App.
![Azure Logic App]()
Click add to create a new Logic App. You will be getting various hosting options as per your requirements.
![Logic App]()
Select a suitable detail for your logic app and create one to design your workflow.
![Suitable detail]()
On a successful Logic App, we can see the overview of the resource.
![Overview]()
![Designer]()
Click on the “Add a trigger” button to get various trigger options as per our requirements.
![Add a trigger]()
In our case, we will be triggering our workflow on creating a new record in the SQL database. Search for SQL and we will get all possible SQL triggers to execute.
![SQL database]()
Select a suitable trigger and add it to your workflow. Add connection details for that connector and select the required parameter as per your workflow design.
![Add connection]()
Here we have added database connection details and selected the target database on which we need the trigger. Add a suitable query as a parameter to pass on the result set to the next connectors in a series as input.
![Add action]()
Click on the (+) sign to add a new action in the series.
![New action]()
Select suitable actions for your next move. In our case, we are adding a condition where we are validating the newly entered record and take a decision based on the result.
![Condition]()
Select the condition and mention the criteria on which it would be validated. Based on its condition we can add the next Action.
![Select the condition]()
Next we will add a Gmail connector in which we are sending mail from the respective mail ID to other mail IDs from the parameter. Even we can use another parameter as in the mail body or subject.
![Gmail connector]()
If the condition is true, then we are sending out a mail having a parameter in the mail body or subject.
![Parameter]()
We are adding a calendar controller to create an event after validating using the condition. Filling the required parameter for calendar event and use function for some parameter values.
![Calendar controller]()
![Event]()
Please check below workflow design below in a complete overview where we have shown the entire design in one frame.
![Frame]()
As per the condition has set if any new record get added with a salary more than or equal to 75000 then an email will send out to notify that.
![New record]()
As we have already saved and run the logic app. Once this record gets entered in Azure SQL then it will get triggered on a new record add. We can view the status of the Logic App and track the success of every connector in the entire workflow.
![Azure SQL]()
As a result, we have received a mail with employee details and even we have created an event on the calendar.
![Employee details]()
Let’s say we will be adding another employee with less than 75000 salary and will be creating only a calendar event not sending out mail.
![Outmail]()
Benefits of Azure Logic App
- Scalability and reliability: As a managed service, it automatically scales and processes large volumes of data with minimal setup.
- Easy integration: Logic Apps provides a wide range of built-in connectors for seamless integration with various services such as SharePoint, and Dynamics 365 and external services such as Google, Twitter, and more.
- Rapid development: Logic Apps offers a no-code/low-code platform with a visual designer that enables the creation of workflows quickly and efficiently.
- Security: Logic Apps provides integration with Azure Active Directory for authentication and conforms to enterprise security standards, ensuring data security.
- Cost-effective: Users only pay for the actions and triggers they use, making it a cost-effective process automation solution.
Components of Azure Logic App
- Triggers: Triggers determine how a workflow starts. This can be an event (such as a new item in the database) or a scheduled trigger (such as a recurring task).
- Actions: Actions or steps that a workflow performs, such as sending an email, updating a database, or making an API call.
- Connectors: Connectors provide pre-built functionality to connect to other services (such as Office 365, SQL Server, Azure Storage) and APIs.
- Workflow: The main element that represents the logic and sequence of actions to be performed according to defined conditions.
- Conditions and loops: Logic Apps supports conditional branching and loops. It allows the workflow to make repeated decisions or actions. based on data.
Reference
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview