Skip to content

Creating a VXC between an MVE and Microsoft Azure with the API

This topic steps through the API procedure to create a VXC from an MVE to Microsoft Azure ExpressRoute. Configuration is a two step process: first, you look up Azure interconnect locations with the Azure service key, and then you can create the VXC.

Note

Before you can connect to Azure, you need to set up an ExpressRoute circuit in the Azure console. When set up, you receive a service key with connection details. To configure your MVE connection to Azure, you look up the service key details and then create VXCs to the Azure ports.

The MVE to Azure deployment includes these tasks:

  1. Set up an ExpressRoute circuit in the Azure console

    When deployed, you get a service key. When you validate a service key, you are presented with primary and secondary ports and can choose the port for the connection. You can use the key a second time and create another connection to the unused port.

    For more information, see the Microsoft help topic Tutorial: Create and modify an ExpressRoute circuit.

  2. Validate the Azure service key

    When ordering an Azure service, use the service key and ensure there is a free port for a connection.

    The API response includes ExpressRoute details of the associated ports and peers. You need the Azure port details to create the VXC.

  3. Create and deploy a VXC

    With the validated service key and port details, create the VXC to Microsoft Azure from the MVE.

    As part of the VXC configuration, you can choose the peering type. The peering type can be either private or Microsoft.

    A defined peering type results in automatically configured peering with peers matched on both the Azure and Megaport sides and a deployed system with a known working configuration. You can modify the configuration once deployed.

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

Validate the service key

Use the API to validate a Microsoft Azure service key. The response includes ExpressRoute details of the associated ports and peers. You need the Azure port details to create the VXC.

Review the service key and ensure there is a free Port for a connection. In the API response, available ports are listed as "vxc":null and ports with an assigned value are not available.

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

To validate the service key

  • Use the GET Look Up Azure Service Key API to look up Microsoft Azure location details with the service key:

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

Here is a sample response for a pairing key with an available port (vxc = null).

{
    "message": "Successful lookup",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": {
        "bandwidth": 500,
        "connectType": "AZURE",
        "managed": false,
        "megaports": [
            {
                "productId": 24581,
                "productUid": "fece8275-86ec-4bbd-b328-67ddac6d852e",
                "name": "Sydney Primary",
                "nServiceId": 55860,
                "description": "Azure ExpressRoute at Equinix SY1",
                "companyId": 1475,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "companyName": "Azure ExpressRoute",
                "portSpeed": 10000,
                "locationId": 2,
                "state": "NSW",
                "country": "Australia",
                "port": 24581,
                "type": "primary",
                "vxc": null
            },
            {
                "productId": 24584,
                "productUid": "13f28165-de96-484e-8f99-babb24650e6a",
                "name": "Sydney Secondary",
                "nServiceId": 55863,
                "description": "Azure ExpressRoute at Equinix SY3",
                "companyId": 1475,
                "companyUid": "c40de5ed-4707-4471-a78c-69436de2c505",
                "companyName": "Azure ExpressRoute",
                "portSpeed": 10000,
                "locationId": 6,
                "state": "NSW",
                "country": "Australia",
                "port": 24584,
                "type": "secondary",
                "vxc": null
            }
        ],
        "peers": [],
        "resource_type": "csp_connection",
        "service_key": "197d927b-90bc-4b1b-bffd-fca17a7ec735",
        "vlan": 3901
    }
}

Create and deploy a VXC

With the Azure ExpressRoute port details from the service key lookup, create the VXC to Azure.

You specify the configuration details in the Body of the request. The first productUid identifies the MVE and the bEnd: productUid identifies the Azure interface. You also need to provide the Azure ExpressRoute service key in serviceKey field.

Tip

Look up Azure locations for the B-End of the connection with the v2/dropdowns/partner/megaports endpoint.

You can create multiple connections to an Azure interface, for example, if you need to connect both private and Microsoft peers to the same interface.

Single Azure Peering VLAN

In this example Single Azure Peering VLAN is used. You can tell this because the aEnd innerVlan and the bEnd innerVlan are specified. For Single Azure Peering VLAN both are set to the same value.

If this value is set to 0, a valid inner VLAN will be allocated and set by the system.

Tip

To test your request before you order and see pricing details, use the /v3/networkdesign/validate endpoint with the same Body configuration.

To create a VXC

  1. Create a request with the POST Create VXC to Azure (v3) endpoint:

    POST {baseUrl}/v3/networkdesign/buy
    
  2. Update the Body of the request with the productUid of the MVE, the name of the VXC, the productUid of the Azure port, and the service key.

    Here is a sample request:

[
   {
    "productUid": "02ec2091-46bb-4904-bd17-96c752ff826e",
     "associatedVxcs": [
       {
         "productName": "My New Azure VXC",
         "partnerConfigs" : {
            "connectType": "AZURE",
            "serviceKey": "197d927b-90bc-4b1b-bffd-fca17a7ec735"
         },
         "rateLimit": 1000,
         "term": 12,
         "shutdown": false,
         "aEnd": {
           "innerVlan": 132
         },
         "bEnd": {
           "productUid": "fece8275-86ec-4bbd-b328-67ddac6d852e",
           "innerVlan": 132
         }
       }
     ]
   }
]

After sending the request, you will receive a successful response when the VXC has been ordered.

Here is a sample response:

{
    "message": "VXC [6cf7199e-a273-4352-97f7-3a772bc492e4] created.",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": [
        {
            "createDate": 1680246964379,
            "vxcOrderId": 114015,
            "payerMegaPortId": 155354,
            "nonPayerMegaPortId": 24581,
            "payerMegaPortName": "greg T",
            "nonPayerMegaPortName": "Sydney Primary",
            "payerCompanyId": 1153,
            "nonPayerCompanyId": 1475,
            "payerLocationId": 2,
            "nonPayerLocationId": 2,
            "salesId": null,
            "payerCompanyName": "Megaport Lab",
            "nonPayerCompanyName": "Azure ExpressRoute",
            "payerMegaPortNsId": 397416,
            "nonPayerMegaPortNsId": 55860,
            "payerVlanId": 0,
            "nonPayerVlanId": 0,
            "payerInnerVlanId": 132,
            "nonPayerInnerVlanId": 132,
            "payerApproverName": "Greg Brown",
            "payerApproverId": 50402,
            "nonPayerApproverName": "Greg Brown",
            "nonPayerApproverId": 50402,
            "payerApproval": 1680246964333,
            "nonPayerApproval": 1680246964362,
            "fixedTerm": true,
            "duration": 1,
            "rollover": true,
            "serviceName": "from greg T to Sydney Primary",
            "payerStatus": "APPROVED",
            "nonPayerStatus": "APPROVED",
            "speed": 1000,
            "distanceBand": "METRO",
            "intercapPath": "",
            "awsId": null,
            "promoCode": null,
            "dealUid": null,
            "rateType": "MONTHLY",
            "vxcJTechnicalServiceId": 155735,
            "vxcJTechnicalServiceUid": "6cf7199e-a273-4352-97f7-3a772bc492e4",
            "provisionDate": 1680246964320,
            "orderType": "NEW",
            "monthlyDiscountAmount": null,
            "discountMonths": null,
            "amazonDirectConnectConfigDto": null,
            "amsixConnectConfigDto": null,
            "webAirProvItem": null,
            "sdrcProvItem": null,
            "rate": null,
            "setup": null,
            "asn": null,
            "bgpPassword": null,
            "usageAlgorithm": "POST_PAID_HOURLY_SPEED_METRO_VXC",
            "costCentre": null,
            "azureServiceKey": "197d927b-90bc-4b1b-bffd-fca17a7ec735",
            "oracleVirtualCircuitId": null,
            "serviceKey": null,
            "vxc": {
                "serviceName": "My New Azure VXC",
                "name": "My New Azure VXC",
                "secondaryName": null,
                "technicalServiceId": 155735,
                "technicalServiceUid": "6cf7199e-a273-4352-97f7-3a772bc492e4",
                "requestedDate": 1680246964320,
                "configuredDate": null,
                "currentEstimatedDelivery": null,
                "companyName": "Megaport Lab",
                "companyId": 1153,
                "billingContactName": null,
                "billingContactId": null,
                "adminContactName": null,
                "adminContactId": null,
                "technicalContactName": null,
                "technicalContactId": null,
                "salesName": null,
                "salesId": null,
                "billableId": 147640,
                "billableUsageAlgorithm": null,
                "productType": "VXC",
                "provisioningStatus": "DEPLOYABLE",
                "failedReason": null,
                "inAdvanceBillingStatus": null,
                "provisioningItems": [],
                "tags": [],
                "vxcDistanceBand": "METRO",
                "intercapPath": "",
                "marketplaceVisibility": true,
                "vxcPermitted": true,
                "vxcAutoApproval": false,
                "createDate": 1680246964352,
                "terminationDate": null,
                "contractStartDate": null,
                "contractTermMonths": 12,
                "rateType": "MONTHLY",
                "trialAgreement": false,
                "payerCompanyId": null,
                "nonPayerCompanyId": null,
                "minimumSpeed": null,
                "maximumSpeed": null,
                "rateLimit": 1000,
                "errorMessage": null,
                "market": "Australia",
                "accountManager": null,
                "promptUid": null,
                "components": [],
                "attributes": [],
                "aLocation": null,
                "bLocation": null,
                "aLocationId": null,
                "bLocationId": null,
                "attributeTags": {},
                "createdBy": "f39b8983-256e-4643-adec-9f0b5da09ab7",
                "buyoutPort": null,
                "virtual": false,
                "locked": false,
                "adminLocked": false,
                "bgpShutdownDefault": false,
                "originDomain": null
            },
            "connectType": "AZURE",
            "payerConfig": {},
            "nonPayerConfig": {},
            "attributeTags": {},
            "serviceLicense": null,
            "originDomain": null,
            "fullyApproved": true
        }
    ]
}

Multiple Microsoft peerings (Q-in-Q)

If you do not want to use Single Azure Peering VLAN and want to use Q-in-Q to have multi Microsoft peerings on a single VXC, only specify the aEnd innerVlan value.

With Q-in-Q in play, the Azure peering VLAN ID set in Azure is not shown in the Megaport APIs or Portal. It is configured by the customer in the Azure ExpressRoute peerings and matched on the MVE instance configuration.

In the example below, the aEnd innerVlan field of 100 is actually an outer vlan or s-tag on the MVE. The Q-in-Q inner VLAN (c-tag) running inside the innerVlan is transparent to Megaport.

Note

Azure VXCs are the only cloud VXC type that allow you to specify a double-tagged VXC.

Here is a sample request:

[
 {
"productUid": "02ec2091-46bb-4904-bd17-96c752ff826e",
 "associatedVxcs": [
   {
     "productName": "My New Azure VXC",
     "partnerConfigs" : {
        "connectType": "AZURE",
        "serviceKey": "{{ service_key }}"
     },
     "rateLimit": 1000,
     "term": 12,
     "shutdown": false,
     "aEnd": {
       "innerVlan": 100
     },
     "bEnd": {
       "productUid": "{{ azurepuid }}"
     }
   }
 ]
 }
]

Last update: 2024-04-15