Deploying ExpressRoute with Megaport in 1 hour

I have heard some organizations complaining that deploying a fully functional ExpressRoute circuit takes too long: days, or even weeks. Does this always have to be like that?

I recently got access to Megaport‘s service portal: Megaport is one of Azure ExpressRoute providers, and they can provision virtual routers dynamically and connect them to Azure ExpressRoute private and Microsoft peerings. Additionally, the Megaport API allows to interact with the services programmatically to deploy them, modify them and delete them. So here is the question: would I be able to code a script that deploys an Azure environment end to end, including ExpressRoute connectivity, in under 1 hour?

The first step was creating some code to interact with the Megaport API. I decided to use curl as my client, because you can easily use it in bash scripts together with the Azure CLI. And here the result: megaport.sh. Essentially a wrapper for the Megaport API that allows to login to the Megaport API using credentials stored in Azure Key Vault, create Megaport Cloud Routers, connect them to Azure ExpressRoute, and delete them when they are no longer needed.

Once that script was ready, I only needed to create some Azure resources, and plumb everything together. My main goal here is automating the creation of testbeds with which I can test and debug ExpressRoute designs, for which I need to simulate an on-premises network. I do that by connecting a second circuit to the Megaport Cloud Router, in a topology similar to this one:

Test lab to simulate ExpressRoute connections with Azure

Obviously, a production setup would look like different to the diagram above, that is just my ExpressRoute testbed creation script.

And the resulting script is not too complex, you can see the final result here: expressroute.azcli. If you look at the script commands, the most time-consuming activity is creating the Azure ExpressRoute gateways, which can take around half an hour. The whole script runs unattended without any user input or click, so you can start it, go have lunch, and you will find a fully functional ExpressRoute environment when you come back.

Thanks to Megaport for showing how easy Azure ExpressRoute can be!

2 thoughts on “Deploying ExpressRoute with Megaport in 1 hour

  1. Mauricio

    Hi Jose thanks a lot for doing this. I’m not part of any org that consumes the cost of having an ExR Circuit so was wondering if I want to have one for testing purposes how expensive would it be?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: