How To Test Network Latency To Azure Using The Azspeedtest Community PowerShell Module

Brandon Olin, DevOps extraordinaire decided to demonstrate a module he created called Azspeedtest to show us how to test latency between Azure storage accounts. I’m sure glad he created the module for us. You should see that code. He made it too easy. I still wonder if he’s secretly got some ulterior motive he gives so much to the community.

This snip will go over how to test network latency to an Azure region. Let's get started. We're going to use a powershell module that I've created and published to the powerShell Gallery call. AZ speed test. This module test latency to Azure storage accounts that I pre provisioned in Azure. Let's go ahead and install this module from the powerShell Gallery. Now that that's installed we can import it into ou session. OK let's take a quick look at the commands available in this module. You can see we only have 2 commands in this module get AZ region and test AZ region latency. If if we were only get AZ Region Command. You can see we've returned the list of Azure regions. Around the globe. When we run the test AZ region latency command. We can pick one or more of these regions to test. Let's go ahead and perform a latency test to a few Azure regions. I'm going to test both the West us an East US regions and perform 25 test iterations to get a better representative sample. Now let's take a look at the results. Looks like my average latency to the West US region is 156 milliseconds and to the East US region. It's about 400 milliseconds. If we need to access the raw test results, we can take a look at the raw results property. Let's take a look at the West US region. This information could be useful if you'd like to perform deeper analysis or store this information in a database. If you want the test all Azure regions. Globally, we can leave off the region parameter. Here, I'm going to perform a single tests against all Azure regions. We can then sort this based on the average latency to find the fastest and slowest regions from my location. And that's how you can test network latency to Azure regions, with powerShell and the AZ speed test module.