This content originally appeared on DEV Community and was authored by Marcel.L
Github/DevOps service status
As described in my previous post, you can easily check the status of Github and DevOps services:
Additionally, status pages for both Github and DevOps have RSS feeds we can subscribe to. In fact the Azure platform itself also has its own health status page you can take a look at here: https://status.azure.com/en-us/status/.
In todays tutorial we will build a basic Azure Logic App that will subscribe to each services RSS feed and send us email notifications on feed updates, such as when services become degraded, when health issues occur or when health issues get remediated.
What is an Azure Logic app?
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. As a member of Azure Integration Services, Logic Apps simplifies the way that you connect legacy, modern, and cutting-edge systems across cloud, on premises, and hybrid environments.
What do we need?
- Azure Logic App: We will create a multi-tenant logic app using the Consumption pricing plan.
- Email Account: We will also need an email account from a service that works with Azure Logic Apps, such as Outlook.com. For other supported email providers, review Connectors for Azure Logic Apps.
Create Logic App
In the Azure portal search for logic app
and then add and create the logic app with the following configuration. Under the Basics blade, add the following Instance Details:
Name | Value |
---|---|
Type | Consumption |
Logic App name | {Name} |
Publish | Workflow |
Region | {Region} |
Add any tags optionally and then select Review + Create, and create the Logic App.
Configure Logic App
After the Logic App has been created navigate to the resource, once you click on the resource, the Azure portal will navigate into the Logic Apps Designer, here we will select a new Blank Logic App:
Next we will create a schedule trigger. On the connectors and triggers search bar type: schedule
and select the trigger called recurrence
:
We will set this trigger to run every 3 minutes.
Next we will add each of our RSS feeds as parallel actions underneath our schedule. Click on + New step
underneath the recurrence
trigger and search for rss
. We will add the action "List all RSS feed items" 3x times as we want to check three RSS feeds, one for each service:
- https://www.githubstatus.com/history.rss - Github RSS status feed.
- https://status.dev.azure.com/_rss - Azure Devops RSS status feed.
- https://azurestatuscdn.azureedge.net/en-gb/status/feed/ - Azure platform RSS status feed.
We will configure each action under our recurrence schedule with the following values:
Parameter Name | Value |
---|---|
The RSS feed URL | {RSS URL Feed} |
since | addminutes(utcnow(), -3) |
NOTE: We are only using the since
parameter and an expression addminutes(utcnow(), -3)
as the value, which will basically instruct our logic app to check the given RSS feed for any new posts within the last 3 minutes. Since our logic app will run on a recurring schedule every 3 minutes, checking for new posts within the last 3 minutes, we should never miss any updates.
Also note that we can rename our action so that it is easier to identify:
After setting up our first RSS action, underneath our schedule
trigger we will click on the +
sign and select the option add a parallel branch
:
Similarly we will add an action for our devops status RSS feed and repeat the process a third time to also add our azure status RSS feed. After adding all our feeds as parallel actions, our Logic App design should look like this:
Now that all 3 actions have been set up the last thing we need to configure are our email actions. We will create 3x email actions, one for each RSS feed. After each action you will see a +
sign. Click on the +
and select Add an action:
Search for control
and then select the action for each
:
We can again rename our control action so that it is easier to identify. Within the for each action we will configure Body
as the output from previous steps and then add an action. In the search box, enter send an email
so that you can find connectors that offer this action. If you have a Microsoft work or school account and want to use Office 365 Outlook. Or, if you have a personal Microsoft account, select Outlook.com. This example continues with Outlook.com. Select Send and email (V2):
Many connectors require that you first create a connection and authenticate your identity before you can continue. Our selected email service prompts us to sign in and authenticate our identity before we can continue:
Once authenticated we can configure our e-mail template:
Note that we can populate our email template with dynamic content to add details about the RSS feed we configured earlier:
As you can see from the next screen, we have created 3x email actions, each with their own unique email template for each given RSS status feed:
Remember to save the logic app when finished. That is it! Optionally we can also select Run Trigger to manually trigger a test run of the Logic App we created.
Now every time a new health status is posted to any of our configured RSS feeds, we will be notified via an email notification containing the details of the affected service.
I hope you have enjoyed this post and have learned something new. You can also find the JSON code sample and template of the Logic App we built in this tutorial on my Github page. ❤️
Author
This content originally appeared on DEV Community and was authored by Marcel.L
Marcel.L | Sciencx (2021-08-30T19:28:52+00:00) DevOps/Github service notifications using Azure Logic Apps. Retrieved from https://www.scien.cx/2021/08/30/devops-github-service-notifications-using-azure-logic-apps/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.