When working with cloud services like Microsoft 365 or Azure Active Directory in particular, it’s very important to stay on top of new features and/or product changes. As you might know, the documentation for these services is stored on GitHub. This is where those changes will often reflect.
I was inspired by the post of Albert-Jan Schot (Get notified for PnP updates from GitHub · CloudAppie), where he explained how to use the GitHub REST API to keep track of issues and new releases. That inspired me to build a Logic App that will keep me informed on changes in the articles that I’m interested in. Now, I’m fully aware of the capabilities of the platform itself to get notified on specific events, but if you don’t hang out on GitHub all day (like me), this might be the solution for you.
In this post, I use Logic Apps, but this will also work with Power Automate. It’s up to you!
I’d like to show you how you can build an automated flow that will notify you of commits on Azure AD documentation on a daily basis. We will use the free and open API from Github, so there is no need for authentication whatsoever. Do know that the API is limited, but if you trigger your Logic App or flow once a day, you should be fine.
My Logic App will run each day at 8 AM and will pull all commits for specific pages. Please reach out to Albert-Jan’s post to learn how those URL’s are built up.
In my example, we are looking at this URL:
https://api.github.com/repos/MicrosoftDocs/azure-docs/commits?path=/articles/active-directory
Note that this is our base URL. I will also specify some subpages that I’m interested in. In this case, MicrosoftDocs/azure-docs is our repo. All pages that follow are specified in the path parameter.
- Repo
- Path
- Subpages
The commits are then filtered only to show the commits from the past 24 hours. Next, I will put all data into an HTML table that I can then send via email. Let’s dive in!
The Logic App / Power Automate flow
This Logic App is publicly available here and can be used as an example to build your own solution. I will now go through some details so that you understand what’s going on.
- This will set the trigger of the Logic App. In this case, the flow will run every day at 8 AM.
- This is the prefix to point to the GitHub API.
- Here I point to the repo, which is MicrosoftDocs/azure-docs
- The last part is the path. This will point to a deeper page within the repo.
- Here, I will initialize the HTML tables variable. This will store a bunch of HTML tables that will be sent via email later on.
- These are the subpages that I want to monitor. You can simply add or remove pages to that array. Check this page to see all the subpages for this path.
- Here I will parse the pages, so I can use them later on as dynamic content.
- Here, I created some CSS styling so that the HTML table will look pretty. Source: Power Automate HTML Table Styling – Ryan Maclean (ryanmaclean365.com)
- Here I will do a for-each action. I use the body of the parsed subpages as the input.
- Here I will get the commits from GitHub API using the variables that I created earlier.
- This step will parse all info. I made some tweaks to the schema because some committers do not provide all attributes (shame). Some of the objects and strings do have null values.
- Here I will filter the commits to show only commits within the timeframe specified in Expression.
- The expression is currently set to -1 day so that it will grab all the commits from the last day.
- This step will create a nice HTML table and add the fields I’m interested in.
- I will check if the body contains data. If not, no action will be taken. This will prevent empty HTML tables in the email later on.
- If the table has data, I will add the HTML table to the variable.
I use a trick to properly format the URL. I learned that from this post: How to add hyperlink in the ‘Create HTML table’ Power Automate action (tomriha.com)
- Next, I will check if the variable is not empty. If empty, no mail will be sent.
- In this step, I will use the Outlook connector to send an email.
- Here I have put the CSS styling and the HTML variable.
- Last but not least, provide the email address.
The end result
Okay, I must admit, it does not look pretty, but I really love the way this works. Now, I can check out all the commits from one single place. Right off the bat, I see a commit from Rob de Jong on the hybrid section, so that might tell us there is a new release of Azure AD Connect! See how effective this is?
The deep link will take you straight to the commit to check out what changed. This can be really valuable information.
Not all commits do have a revealing message attribute that will tell you exactly what changed, but hopefully, that will improve in the future. So dear Microsoft committer, if you are reading this…….. ?
Stay safe!
Pingback: Intune Newsletter - 14th October 2022 - Ignite Special - Andrew Taylor