In JavaScript (easily PowerShellable):
const feedUrl = 'https://azure.microsoft.com/en-us/status/feed/';
async function isAzureDown() {
// This is an OPTIONS call
let response = await fetch(url, {
headers: { 'x-requested-with': 'xhr' }
});
// This is the GET
let data = await response.text();
ready = true;
return data.search(/<item>/i) != -1 ? true : false;
}
This will return true if any child nodes called <item> are found in the response. Just foreach across <item> and return title and description if you need that. If there's no <item>, all services are up, the function returns false.
Here's a capture from that feed during an incident -
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:az="http://azure.com/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Azure Status</title>
<link>https://status.azure.com</link>
<atom:link href="https://status.azure.com" rel="self" type="application/rss+xml" />
<description>Azure Status</description>
<pubDate>Wed, 20 Jul 2016 23:48:45 GMT</pubDate>
<item>
<title>SQL Database - East US - Advisory</title>
<description>Starting at approximately 21:30 UTC on 20 Jul 2016 customers using SQL Database in East US may experience issues accessing services. New connections to existing databases in this region may result in an error or timeout, and existing connections may have been terminated. Engineers are currently investigating and the next update will be provided in 60 minutes or as events warrant.</description>
<pubDate>Wed, 20 Jul 2016 23:02:32 GMT</pubDate>
<link>http://status.azure.com</link>
<category>SQL Database</category>
<az:tags>
<az:tag>East US</az:tag>
</az:tags>
</item>
</channel>
</rss>
And here's an everything is awesome one -
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom"
version="2.0">
<channel xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Azure Status</title>
<link>https://azure.microsoft.com/en-us/status/</link>
<description>Azure Status</description>
<language>en-US</language>
<lastBuildDate>Fri, 03 May 2019 08:55:00 Z</lastBuildDate>
</channel>
</rss>
Yes this is horrible, yes there should be an easier way to do this, there's also no CORS support for that feed endpoint so you can't do it from a single page app. PowerShell should be fine.
Sample implementation (while it lasts, .wtf domains cost a small fortune, who knew) -
A Python implementation here -
https://github.com/snobu/azure-ticker