action.skip

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

This topic describes 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 more information, 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 more information, see the Microsoft help topic Create and modify peering for an ExpressRoute circuit.

  4. Configure customer premises equipment (CPE) device.

Before you begin, obtain a valid access token. For more information, see Creating an API Key.

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.

To validate the service key in the Postman collection

  1. In Postman, expand Cloud Connectivity > Port > Azure in the left navigation and select GET Look Up Azure Service Key.

  2. Add the service key to the endpoint.

  3. Click Send to make a GET request to the API server.

    GET {baseUrl}/v2/secure/azure/{service_key}
    

Here 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 more information about each response field, see Azure Service Key Response Fields.

Create and deploy the VXCs

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

To create the VXCs

  1. Select POST Create VXC to Azure (v3).

    Tip

    To test your request before you order and see pricing details, you can use: POST {baseUrl}/v3/networkdesign/validate

  2. 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.

  3. Click Send to post the request.

    POST {baseUrl}/v3/networkdesign/buy
    
[
    {
        "productUid": "1544f278-ec03-11e5-9ce9-5e5517507c66", //port UID of your Megaport (A-End)
        "associatedVxcs": [
            {
                "productName": "Primary Azure VXC",
                "rateLimit": 200,
                "term":12,
                "shutdown": false,
                "promoCode": "promox3mnthfree2",
                "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 (megaports:vxc).

{
    "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.