# API - Connect to Microsoft Azure ExpressRoute Establish a direct, layer 2 connection to Microsoft Azure to access the Azure Cloud Infrastructure and other Azure Cloud services. ![Three steps: find your Microsoft service key in Azure portal, create connection using Fabric APIs, set up Microsoft peering](https://docs.equinix.com/assets/images/connectToMicrosoftAzure-7cbea56c79acbe0302b172a682b43b7e.jpg) > **Note** > > This document covers creating a connection from a port, service token, or cloud router in the API. For information on creating a connection from a virtual device, including in the API, see [Network Edge to Azure ExpressRoute](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/ne-azure-expressroute.md) ## Prerequisites[​](#prerequisites "Direct link to Prerequisites") 1. Authenticate - Submit your user credentials, Client ID, and Client Secret for OAuth2 authentication. Refer to [API Authentication](https://docs.equinix.com/equinix-api/api-authentication.md) for instructions on how to call OAuth API to validate and authenticate your credentials. 2. Determine Your A-side Information. Either: * Determine your Equinix Fabric ports information by sending a `GET` request to the [`/fabric/v4/ports`](https://docs.equinix.com/api-catalog/fabricv4/ports/getports.md) endpoint. You need the port UUID(s) and the link protocol type (DOT1Q or QINQ), OR * Retrieve your a-side service token or tokens by sending a `GET` request to the [`/fabric/v4/serviceTokens`](https://docs.equinix.com/api-catalog/fabricv4/#tag/Service-Tokens/operation/getServiceTokens) endpoint. You need the token's UUID. The a-side token provides the relevant information to configure the a-side of the connection. OR * Determine your Fabric Cloud Router information. Check your available cloud routers by sending a `POST` request to the [`/fabric/v4/routers/search`](https://docs.equinix.com/api-catalog/fabricv4/cloud-routers/searchcloudrouters.md) endpoint. You need the router's UUID. 3. Identify the Azure ExpressRoute service profile information. More information on which service profile you should choose is on the [Azure ExpressRoute Overview](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/azure-express-route-overview.md#azure-express-route-service-profiles) page. * Azure ExpressRoute - `a1390b22-bbe0-4e93-ad37-85beef9d254d` * Azure Government ExpressRoute - `0de4e413-edd7-4325-912f-7c8a4428e156` 4. Identify and validate your ExpressRoute Service Key. Send a `POST` request to the [`/fabric/v4/connections/validate`](https://docs.equinix.com/api-catalog/fabricv4/connections/validateconnections.md) endpoint to verify that your ExpressRoute Service Key can be used to create a connection to the selected service profile in the given metro. ## Connecting from a DOT1Q Port[​](#connecting-from-a-dot1q-port "Direct link to Connecting from a DOT1Q Port") To create a connection from your DOT1Q port to Azure ExpressRouter, send a `POST` request to the [`/fabric/v4/connections`](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md) endpoint. The connection `type` is `EVPL_VC`. Provide your port information in the `aSide` object including: * `accessPoint.type` as `COLO` * Provide your port's UUID to `port.uuid` * linkProtocol.type as `DOT1Q` * Provide the VLAN ID to `linkProtocol.vlanTag` Provide your Azure ExpressRoute details and location details in the `zSide` object including: * Set `accessPoint.type` as `SP`. * Set `profile.type` as `L2_PROFILE`. * Specify the Azure ExpressRoute service profile you are connecting to in `profile.uuid`. * Specify the Equinix Metro location you are connecting to in `location.metroCode`. * Set `authenticationKey` as your ExpressRoute Service Key . * Set `peeringType` as `MICROSOFT` or `PRIVATE`, depending on the services you are using the connection for. For more information, see [Configuring Peering](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/azure-express-route-overview.md#configuring-peering). * (*Optional*) Set `linkProtocol.type` to `QINQ` and specify a `linkProtocol.vlanCTag`. This sets the ExpressRoute VLAN ID used for peering. You can also set this value in the Azure portal after creating the connection. Specify any other connection configuration details, including `bandwidth` and `redundancy`, in the body of the request. For a full list of parameters and their descriptions, see the [API Reference](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md). Sample cURL Request: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{ "type": "EVPL_VC", "name": "", "bandwidth": , "redundancy": { "priority": "" }, "aSide": { "accessPoint": { "type": "COLO", "port": { "uuid": "" }, "linkProtocol": { "type": "DOT1Q", "vlanTag": } } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "L2_PROFILE", "uuid": "" }, "location": { "metroCode": "DC" }, "linkProtocol": { "type": "QINQ", "vlanCTag": }, "peeringType": "", "authenticationKey": "" } }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] } ``` ## Connecting from a QINQ port[​](#connecting-from-a-qinq-port "Direct link to Connecting from a QINQ port") To create a connection from your DOT1Q port to Azure ExpressRouter, send a `POST` request to the [`/fabric/v4/connections`](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md) endpoint. The connection `type` is `EVPL_VC`. Provide your port information in the `aSide` object including: * `accessPoint.type` as `COLO` * Provide your port's UUID to `port.uuid` * linkProtocol.type as `QINQ` * Provide the inner tag ID to `linkProtocol.vlanCTag` * Provide the outer tag ID to `linkProtocol.vlanSTag` Provide your Azure ExpressRoute details and location details in the `zSide` object including: * Set `accessPoint.type` as `SP`. * Set `profile.type` as `L2_PROFILE`. * Specify the Azure ExpressRoute service profile you are connecting to in `profile.uuid`. * Specify the Equinix Metro location you are connecting to in `location.metroCode`. * Set `authenticationKey` as your ExpressRoute Service Key . * Set `peeringType` as `MICROSOFT` or `PRIVATE`, depending on the services you are using the connection for. For more information, see [Configuring Peering](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/azure-express-route-overview.md#configuring-peering). * (*Optional*) Set `linkProtocol.type` to `QINQ` and specify a `linkProtocol.vlanCTag`. This sets the ExpressRoute VLAN ID used for peering. You can also set this value in the Azure portal after creating the connection. Specify any other connection configuration details, including `bandwidth` and `redundancy`, in the body of the request. For a full list of parameters and their descriptions, see the [API Reference](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md). Sample cURL Request: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{ "type": "EVPL_VC", "name": "", "bandwidth": , "redundancy": { "priority": "" }, "aSide": { "accessPoint": { "type": "COLO", "port": { "uuid": "" }, "linkProtocol": { "type": "QINQ", "vlanSTag": , "vlanCTag": } } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "L2_PROFILE", "uuid": "" }, "location": { "metroCode": "" }, "authenticationKey": "" } }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] }' ``` ## Connecting Using a Service Token[​](#connecting-using-a-service-token "Direct link to Connecting Using a Service Token") To create a connection from your DOT1Q port to Azure ExpressRouter, send a `POST` request to the [`/fabric/v4/connections`](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md) endpoint. The connection `type` is `EVPL_VC`. Provider your Service Token UUID to in the `aSide` object. The service token provides all other necessary information to establish the connection. Provide your Azure ExpressRoute details and location details in the `zSide` object including: * Set `accessPoint.type` as `SP`. * Set `profile.type` as `L2_PROFILE`. * Specify the Azure ExpressRoute service profile you are connecting to in `profile.uuid`. * Specify the Equinix Metro location you are connecting to in `location.metroCode`. * Set `authenticationKey` as your ExpressRoute Service Key . * Set `peeringType` as `MICROSOFT` or `PRIVATE`, depending on the services you are using the connection for. For more information, see [Configuring Peering](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/azure-express-route-overview.md#configuring-peering). * (*Optional*) Set `linkProtocol.type` to `QINQ` and specify a `linkProtocol.vlanCTag`. This sets the ExpressRoute VLAN ID used for peering. You can also set this value in the Azure portal after creating the connection. Specify any other connection configuration details, including `bandwidth` and `redundancy`, in the body of the request. For a full list of parameters and their descriptions, see the [API Reference](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md). Sample cURL Request: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{ "type": "EVPL_VC", "name": "", "bandwidth": , "redundancy": { "priority": "" }, "aSide": {    "serviceToken": { "uuid": "" } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "L2_PROFILE", "uuid": "" }, "location": { "metroCode": "" }, "authenticationKey": "" } }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] }' ``` ## Connecting from a Fabric Cloud Router[​](#connecting-from-a-fabric-cloud-router "Direct link to Connecting from a Fabric Cloud Router") To create a connection from your Network Edge device to AWS, send a `POST` request to the [`/fabric/v4/connections`](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md) endpoint. The connection `type` is `IP_VC`. Define your Fabric Cloud Router in the `aSide` object including: * Set `accessPoint.type` as `CLOUD_ROUTER`. * Set `router.uuid` as your router's UUID. Provide your Azure ExpressRoute details and location details in the `zSide` object including: * Set `accessPoint.type` as `SP`. * Set `profile.type` as `L2_PROFILE`. * Specify the Azure ExpressRoute service profile you are connecting to in `profile.uuid`. * Specify the Equinix Metro location you are connecting to in `location.metroCode`. * Set `authenticationKey` as your ExpressRoute Service Key . * Set `peeringType` as `MICROSOFT` or `PRIVATE`, depending on the services you are using the connection for. For more information, see [Configuring Peering](https://docs.equinix.com/fabric-marketplace/connecting-to-service-provider/microsoft/azure-express-route-overview.md#configuring-peering). * (*Optional*) Set `linkProtocol.type` to `QINQ` and specify a `linkProtocol.vlanCTag`. This sets the ExpressRoute VLAN ID used for peering. You can also set this value in the Azure portal after creating the connection. Specify any other connection configuration details, including `bandwidth` and `redundancy`, in the body of the request. For a full list of parameters and their descriptions, see the [API Reference](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnection.md). ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{ "type": "IP_VC", "name": "", "bandwidth": , "redundancy": { "priority": "" }, "aSide": { "accessPoint": { "type": "CLOUD_ROUTER", "router": { "uuid": "" } } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "L2_PROFILE", "uuid": "" }, "location": { "metroCode": "" }, "authenticationKey": "" } }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] }' ``` ## Monitoring the Connection Status[​](#monitoring-the-connection-status "Direct link to Monitoring the Connection Status") Send a `GET` request to the [`fabric/v4/connections/{connectionId}`](https://docs.equinix.com/api-catalog/fabricv4/connections/getconnectionbyuuid.md) endpoint to monitor connection status. | Equinix Connection States | | Azure States | | | | ------------------------------------ | ------------------------------------- | ------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`equinixStatus`** attribute values | **`providerStatus`** attribute values | **Provider Status** | **Peerings Status** | **Description** | | `PROVISIONING` | `PROVISIONING` | Not provisioned | Not provisioned | Connection request has not been sent to Microsoft yet. | | `PENDING_BGP_PEERING` | `PENDING_BGP` | Provisioned | Not provisioned | The connection has been approved and awaits for the customer to configure Microsoft peering on the Microsoft Azure portal. If you are connecting to Azure ExpressRoute from a Port, the status remains `PENDING_BGP_PEERING` until peering is completed in the Microsoft Azure portal and the status only changes to `PROVISIONED` once Equinix Fabric syncs with Microsoft. If you want to synchronize the BGP peering instantly, use [Connection Actions](https://docs.equinix.com/api-catalog/fabricv4/connections/createconnectionaction.md) API endpoint. If you are connecting to Azure ExpressRoute from a Fabric Cloud Router, you also need to [configure your routing details](https://docs.equinix.com/fabric-cloud-router/bgp/fcr-bgp.md) for the connection in the Equinix Customer Portal. | | `PROVISIONING` | `PROVISIONED` | | | Provisioning completed at Microsoft's end and the connection is provisioning at Equinix's end. | | `PROVISIONED` | `PROVISIONED` | | | Connection established. |