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
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:
- Go to ExpressRoute circuits → Create
- Choose Provider: Megaport and the location matching your Megaport port
- Select your bandwidth tier
- Create the circuit — it will show Provider status: Not Provisioned
- Copy the Service key (a UUID format string)
Step 1 — Find Azure partner ports
# 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
megaport-cli ports list
megaport-cli ports list --port-name "Sydney" --output json | jq '.[0].uid'
Step 3 — Create the VXC
Interactive
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)
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)
megaport-cli vxc buy --json-file ./azure-vxc.json
Example azure-vxc.json with full BGP peering configuration:
{
"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
| Field | Required | Description |
|---|---|---|
connectType | Yes | Always "AZURE" |
serviceKey | Yes | UUID from your Azure ExpressRoute circuit |
peers | No | Array of BGP peering configurations |
Peer configuration fields:
| Field | Description |
|---|---|
type | "Private" (to VNet) or "Microsoft" (to Microsoft 365/public services) |
peerASN | Your BGP ASN as a string |
primarySubnet | Primary /30 subnet for BGP (e.g. 169.254.21.0/30) |
secondarySubnet | Secondary /30 subnet for redundancy |
prefixes | CIDR blocks you want to advertise |
sharedKey | BGP MD5 authentication key |
vlan | VLAN 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
megaport-cli vxc get <VXC-UID>
megaport-cli vxc status <VXC-UID>
Status transitions: CONFIGURED → LIVE
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:
- Azure Portal → ExpressRoute circuits — confirm Provider status:
Provisioned - Create a Private Peering under your circuit (if not already configured via the
peersarray) - 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.
# 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?
- Connect to AWS — same pattern for AWS Direct Connect
- Port Lifecycle — manage the port your VXC connects to
- MCR Routing — add a Cloud Router to connect AWS and Azure through Megaport
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.