Skip to content
Intermediate - Solutions Architect 30 minutes

Connect to Azure

Provision an Azure ExpressRoute VXC using the Megaport CLI — from service key to a live private connection

Prerequisites

  • Active Megaport port in an Azure ExpressRoute location
  • Azure subscription
  • Azure ExpressRoute circuit (with service key)

This tutorial provisions a private connection from your Megaport port to Azure via ExpressRoute. Azure's service key model means you create the circuit in Azure first, then bring that key to Megaport to activate the connection.

Architecture

🏢PortEquinix SY3
VXC1 Gbps
🔗Azure PartnerMegaport hosted
☁️ExpressRoute
🌐VNet

How it works

Azure ExpressRoute uses a service key — a unique identifier for your circuit. You create the circuit in Azure to get the service key, then provide that key when creating the Megaport VXC. Unlike AWS, there's no manual acceptance step: Azure automatically activates once Megaport provisions the connection.


Step 0 — Create an ExpressRoute circuit in Azure

ℹ️

Azure first

The Azure ExpressRoute circuit must exist before you create the Megaport VXC. Megaport needs the service key to route the connection correctly.

In the Azure Portal:

  1. Go to ExpressRoute circuits → Create
  2. Choose Provider: Megaport and the location matching your Megaport port
  3. Select your bandwidth tier
  4. Create the circuit — it will show Provider status: Not Provisioned
  5. Copy the Service key (a UUID format string)

Step 1 — Find Azure partner ports

bash
# List all Azure partner ports
megaport-cli partners list --company-name "Microsoft Azure"

# Filter to your location
megaport-cli partners list --company-name "Microsoft Azure" --location-id 3

# Filter by product name (ExpressRoute vs others)
megaport-cli partners list --product-name "Azure" --location-id 3

Step 2 — Get your port UID

bash
megaport-cli ports list
megaport-cli ports list --port-name "Sydney" --output json | jq '.[0].uid'

Step 3 — Create the VXC

Interactive

bash
megaport-cli vxc buy --interactive

When prompted "Do you want to configure A-End partner?" answer No (your Port doesn't need a partner block); when prompted "Do you want to configure B-End partner?" answer Yes (Azure needs connectType: "AZURE" plus the service key). See Partner Configurations for the full rule.

Flags (minimal — service key only)

bash
megaport-cli vxc buy \
  --name "Azure ExpressRoute - Sydney" \
  --a-end-uid <PORT-UID> \
  --a-end-vlan 200 \
  --rate-limit 1000 \
  --term 12 \
  --b-end-partner-config '{"connectType":"AZURE","serviceKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}'

JSON file (with BGP peering config)

bash
megaport-cli vxc buy --json-file ./azure-vxc.json

Example azure-vxc.json with full BGP peering configuration:

json
{
  "name": "Azure ExpressRoute - Sydney",
  "rateLimit": 1000,
  "term": 12,
  "aEndUid": "abc-1234-5678-def",
  "aEndVlan": 200,
  "bEndPartnerConfig": {
    "connectType": "AZURE",
    "serviceKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "peers": [
      {
        "type": "Private",
        "peerASN": "65001",
        "primarySubnet": "169.254.21.0/30",
        "secondarySubnet": "169.254.22.0/30",
        "prefixes": "10.0.0.0/8",
        "sharedKey": "your-bgp-shared-key",
        "vlan": 200
      }
    ]
  }
}

Azure partner config fields

FieldRequiredDescription
connectTypeYesAlways "AZURE"
serviceKeyYesUUID from your Azure ExpressRoute circuit
peersNoArray of BGP peering configurations

Peer configuration fields:

FieldDescription
type"Private" (to VNet) or "Microsoft" (to Microsoft 365/public services)
peerASNYour BGP ASN as a string
primarySubnetPrimary /30 subnet for BGP (e.g. 169.254.21.0/30)
secondarySubnetSecondary /30 subnet for redundancy
prefixesCIDR blocks you want to advertise
sharedKeyBGP MD5 authentication key
vlanVLAN for the peering
💡

Minimal config first

Start with just connectType and serviceKey to provision the connection. Configure BGP peering details in Azure Portal after provisioning if you prefer.


Step 4 — Monitor provisioning status

bash
megaport-cli vxc get <VXC-UID>
megaport-cli vxc status <VXC-UID>

Status transitions: CONFIGUREDLIVE

Once the VXC is LIVE, check the Azure Portal — the circuit's Provider status should change from Not Provisioned to Provisioned.


Step 5 — Complete on the Azure side

Once both sides show as provisioned:

  1. Azure Portal → ExpressRoute circuits — confirm Provider status: Provisioned
  2. Create a Private Peering under your circuit (if not already configured via the peers array)
  3. Link a Virtual Network Gateway to the ExpressRoute circuit to enable connectivity to your VNet

The connection is fully active once the gateway link shows as Connected.


Clean up (optional)

ℹ️

Order of operations matters

Delete the Megaport VXC before deleting the Azure ExpressRoute circuit. Deleting the circuit first while the VXC exists can leave the connection in an inconsistent state.

bash
# 1. Unlink virtual network gateways in Azure Portal first
# 2. Delete the Megaport VXC
megaport-cli vxc delete <VXC-UID>

# Immediate deletion
megaport-cli vxc delete <VXC-UID> --now

# 3. Then delete the Azure ExpressRoute circuit in Azure Portal

What's next?

💡

For Sales demos

ExpressRoute provisioned in minutes — show this side-by-side with the traditional approach (weeks of lead time, cross-connect orders, manual BGP configuration) to demonstrate the speed advantage of the Megaport fabric.