Creating a VXC between a Port and Microsoft Azure with the API

This topic steps through the API procedure to create a VXC from a Port to Microsoft Azure ExpressRoute, including how to look up Azure port locations and order the VXCs.

The Port to Azure deployment includes these tasks:

  1. Set up an ExpressRoute circuit in the Azure console.
    When deployed, you get a service key. The service key is linked to the assigned ports in Azure. When you validate a service key, the response shows the assigned primary and secondary ports in Azure. You can use the service key twice - once to connect to the primary and a second time and create another connection to the secondary port.

    For details, see the Microsoft help topic Tutorial: Create and modify an ExpressRoute circuit

  2. With the service key, create and deploy your VXCs from the Megaport Portal.

    This step uses the API – the other steps are outside of Megaport in the Azure environment.

  3. With a VXC deployed to your circuit, configure peering in the Azure portal.
    Peering information is shared between the primary and secondary circuits, as is the inner VLAN assigned to the peer.

    For details, see the Microsoft help topic Create and modify peering for an ExpressRoute circuit

  4. Configure customer premises equipment (CPE) device.

Validate the service key

When you use the API to validate an Azure service key, the response includes ExpressRoute details of the associated ports and peers. You need the port details to create the VXCs.

    GET {API Server URL}/v2/secure/azure/{service_key}

This is a sample response for a new key (without configured VXCs).

{
    "message": "Successful lookup",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": {
        "managed": false,
        "connectType": "AZURE",
        "resource_type": "csp_connection",
        "bandwidth": 200,
        "service_key": "3e2480b2-b4d5-424b-976a-7b0de65a1b62",
        "vlan": 3289,
        "megaports": [
            {
                "portSpeed": 10000,
                "name": "Washington DC Primary",
                "state": "VA",
                "description": "Azure ExpressRoute at Equinix DC2/6",
                "productUid": "a7ae8a35-433e-44aa-87cb-a1b7995ab008",
                "nServiceId": 32832,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "country": "USA",
                "vxc": null,
                "port": 14570,
                "companyName": "Azure ExpressRoute",
                "locationId": 67,
                "productId": 14570,
                "type": "primary",
                "companyId": 1475
            },
            {
                "portSpeed": 10000,
                "name": "Washington DC Secondary",
                "state": "VA",
                "description": "Azure ExpressRoute at Equinix DC2/6",
                "productUid": "07ab0ee6-7f77-41ac-bbe6-335e3ee6d182",
                "nServiceId": 36431,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "country": "USA",
                "vxc": null,
                "port": 16108,
                "companyName": "Azure ExpressRoute",
                "locationId": 67,
                "productId": 16108,
                "type": "secondary",
                "companyId": 1475
            }
        ],
        "peers": []
    }
}

The megaports:vxc value is null for both Ports, indicating they are available for new VXCs.

For details about each response field, see Azure Service Key Response Fields.

Create the VXCs

With the details from the service key, create a VXC to the primary port and another VXC to the secondary port.

To order the VXC

POST {API Server URL}/v2/networkdesign/buy

Tip

To test your request before you order and see pricing details, you can use: POST {API Server URL}/v2/networkdesign/validate

Update the Body of the request with the productUid of the Port, the name of the VXC, the productUid of the primary Azure port, and the service key. The maximum speed (rateLimit) is defined in the bandwidth value of the service key response. In this case, it is 200.

[
    {
        "productUid": "1544f278-ec03-11e5-9ce9-5e5517507c66", //port UID of your Megaport (A End)
        "associatedVxcs": [
            {
                "productName": "Primary Azure VXC",
                "rateLimit": 200,
                "aEnd": {
                    "vlan": 102
                },
                "bEnd": {
                    "productUid": "a7ae8a35-433e-44aa-87cb-a1b7995ab008", //retrieved port UID from the Azure service key lookup
                    "partnerConfig" : {
                        "connectType": "AZURE",
                        "serviceKey": "3e2480b2-b4d5-424b-976a-7b0de65a1b62" //service key from lookup response
                    }
                }
            }
        ]
    }
]

When you have configured your primary and secondary VXCs to the Azure ports, another service key lookup shows the VXCs associated with the Azure ports. The VXCs are identified by an ID number.

{
    "message": "Successful lookup",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": {
        "managed": false,
        "connectType": "AZURE",
        "resource_type": "csp_connection",
        "bandwidth": 200,
        "service_key": "3e2480b2-b4d5-424b-976a-7b0de65a1b62",
        "vlan": 3289,
        "megaports": [
            {
                "portSpeed": 10000,
                "name": "Washington DC Primary",
                "state": "VA",
                "description": "Azure ExpressRoute at Equinix DC2/6",
                "productUid": "a7ae8a35-433e-44aa-87cb-a1b7995ab008",
                "nServiceId": 32832,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "country": "USA",
                "vxc": 60621,
                "port": 14570,
                "companyName": "Azure ExpressRoute",
                "locationId": 67,
                "productId": 14570,
                "type": "primary",
                "companyId": 1475
            },
            {
                "portSpeed": 10000,
                "name": "Washington DC Secondary",
                "state": "VA",
                "description": "Azure ExpressRoute at Equinix DC2/6",
                "productUid": "07ab0ee6-7f77-41ac-bbe6-335e3ee6d182",
                "nServiceId": 36431,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "country": "USA",
                "vxc": 60622,
                "port": 16108,
                "companyName": "Azure ExpressRoute",
                "locationId": 67,
                "productId": 16108,
                "type": "secondary",
                "companyId": 1475
            }
        ],
        "peers": []
    }
}

To complete the configuration, configure peering in the Azure portal and configure your CPE devices.


Last update: