{"id":5001,"date":"2020-12-22T16:21:23","date_gmt":"2020-12-22T10:51:23","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=5001"},"modified":"2020-12-22T16:33:45","modified_gmt":"2020-12-22T11:03:45","slug":"an-overview-of-logic-apps-with-its-use-cases","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2020\/12\/22\/an-overview-of-logic-apps-with-its-use-cases\/","title":{"rendered":"An Overview of Logic Apps with its Use Cases"},"content":{"rendered":"\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wakeupandcode.com\/wp-content\/uploads\/2019\/08\/azure-logic-apps400x200.png\" alt=\"See the source image\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n<p>Azure Logic Apps is the PaaS (Platform as a Service) offering from Microsoft Azure. Logic Apps helps us to define workflows and build powerful solutions with the help of connectors, triggers, and actions.<\/p>\r\n<p style=\"font-size:30px;\"><strong>\u00a0Prerequisites<\/strong><\/p>\r\n\r\n\r\n\r\n<p>&#8211; Basic understanding of cloud platform and SQL Query.<\/p>\r\n<p>Let us understand this with a simple example:<\/p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<p><!--more--><\/p>\r\n\r\n\r\n\r\n<p>Let&#8217;s suppose we want to receive an email as soon as there is a new tweet posted on Twitter, that solution can be established using Logic Apps (through connectors)<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5005\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-1.png?w=732\" alt=\"\" width=\"600\" height=\"189\" \/><\/figure>\r\n\r\n\r\n\r\n<p>This is just a basic example. Similarly, many complex workflows can be established using Logic Apps.<\/p>\r\n\r\n\r\n\r\n<p>Another example can be that we can automatically fetch new records from a SQL database and then send email alerts to users.<\/p>\r\n\r\n\r\n\r\n<p>The good thing is that you don&#8217;t need to write a single line of code. Everything can be done using Logic Apps Designer in Azure Portal.<\/p>\r\n\r\n\r\n\r\n<p>As far as the cost is concerned, you only need to pay for the actions you execute in your logic apps. It follows the consumption pricing model.<\/p>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p style=\"font-size:33px;\"><strong>Use Case<\/strong><\/p>\r\n\r\n\r\n\r\n<p>In this demo use case, we will see how you can alert users based on the data present\/updated in your SQL Database.<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 1:<\/strong> Go to the Azure Portal. Fill in the required details and click &#8216;Review + create&#8217; to create your Logic App.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5018\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-2.png?w=691\" alt=\"\" width=\"600\" height=\"487\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 2:<\/strong> Go to the Azure Portal. Fill in the required details and click &#8216;Review + create&#8217; to create your SQL Database.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5022\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-3.png?w=615\" alt=\"\" width=\"600\" height=\"559\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 3: <\/strong>Go to the SQL Database and click &#8216;Query Editor&#8217;.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5024\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-4.png?w=300\" alt=\"\" width=\"300\" height=\"468\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 4:<\/strong> Enter your credentials and you will get the following screen.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5033\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-6.png?w=1024\" alt=\"\" width=\"600\" height=\"189\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>NOTE: If you face the error listed below while logging in, then you need to whitelist your client IP in server firewall settings.<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5029\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-5.png?w=355\" alt=\"\" width=\"355\" height=\"208\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 5:<\/strong> After you have opened the query editor, you need to run the below query. This query will create a table named &#8216;<strong>Alerts<\/strong>&#8216;.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"361\" height=\"167\" class=\"wp-image-5036\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-7.png?w=361\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>You can verify the same in tables. A new table named &#8216;dbo.Alerts&#8217; will be created.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"203\" height=\"145\" class=\"wp-image-5038\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-8.png?w=203\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p><strong>Step 6:<\/strong> Insert records into the Alerts table using the query listed below.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5042\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-9.png?w=973\" alt=\"\" width=\"600\" height=\"71\" \/><\/figure>\r\n\r\n\r\n\r\n<p>(For demo purpose, I am sending 3 mails to my mail address with different subject and body)<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 7:<\/strong> Run the query listed here and verify that the records have been inserted into the table.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-5050\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-11.png?w=207\" alt=\"\" width=\"188\" height=\"20\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5048\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-10.png?w=780\" alt=\"\" width=\"600\" height=\"148\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 8:<\/strong> Go back to the portal and open blank Logic App.<\/p>\r\n\r\n\r\n\r\n<p>From here, we start configuring our Logic App.<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 9:<\/strong> We will use a Recurrence Trigger (Logic App will run automatically at the defined schedule)<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5054\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-12.png?w=582\" alt=\"\" width=\"582\" height=\"218\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 10: <\/strong>Add a new step named &#8216;SQL Server&#8217;. We will use &#8216;Get Rows&#8217; as action.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"381\" class=\"wp-image-5064\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-16.png?w=353\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p><strong>Step 11:<\/strong> Enter the credentials (In background, connectors are getting created). Enter your server name (FQDN), database name, username and password.<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 12:<\/strong> Add a new step &#8216;For-Each&#8217; in the Logic App.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"587\" height=\"237\" class=\"wp-image-5060\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-15.png?w=587\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 13:<\/strong> Select &#8216;Value&#8217; Parameter from Dynamic Content.<\/p>\r\n\r\n\r\n\r\n<p>(Reason for selecting this is we want to fetch each value from previous step and then send email for these values)<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5066\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-17.png?w=937\" alt=\"\" width=\"600\" height=\"227\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 14:<\/strong> Now add a &#8216;Send mail&#8217; Action as below.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5072\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-20.png?w=561\" alt=\"\" width=\"561\" height=\"271\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 15: <\/strong>Enter the details from Dynamic content. We will not be doing hard-coding \ud83d\ude42<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5074\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-21.png?w=634\" alt=\"\" width=\"600\" height=\"368\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 16:<\/strong> Finally SAVE the Logic App.<\/p>\r\n\r\n\r\n\r\n<p><strong>Step 17:<\/strong> Wait for sometime and you will receive an email.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5078\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/12\/image-22.png?w=529\" alt=\"\" width=\"529\" height=\"120\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p>This is how you can create a workflow with the help of Logic Apps. You can play around with it and try adding one more row into the SQL Database. You would receive a mail for that too.<\/p>\r\n\r\n\r\n\r\n<p>Happy Learning \ud83d\ude42<\/p>\r\n<p><a href=\"https:\/\/twitter.com\/logicappsio\" target=\"_blank\" rel=\"noopener\">Image Source<\/a><\/p>\r\n<p>&nbsp;<\/p>\r\n<p>Opstree is an End to End DevOps solution provider<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p><a href=\"https:\/\/www.opstree.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT US<\/a><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Azure Logic Apps is the PaaS (Platform as a Service) offering from Microsoft Azure. Logic Apps helps us to define workflows and build powerful solutions with the help of connectors, triggers, and actions. \u00a0Prerequisites &#8211; Basic understanding of cloud platform and SQL Query. Let us understand this with a simple example:<\/p>\n","protected":false},"author":197679939,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[223461147,69816,230405003,12793557],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-1iF","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/5001"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/197679939"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=5001"}],"version-history":[{"count":25,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/5001\/revisions"}],"predecessor-version":[{"id":5182,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/5001\/revisions\/5182"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=5001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=5001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=5001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}