> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure VXC Setup

> Step-by-step guide to provisioning a Telnyx Virtual Cross Connect (VXC) to Azure ExpressRoute, including circuit setup and BGP configuration.

## Architecture

We will construct the following architecture.

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-architecture.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=23ae060a220a3a00e751a8d4e86e521c" alt="Azure Architecture" width="1524" height="1030" data-path="assets/images/vxc-azure-architecture.png" />

## Prerequisites

### Create ExpressRoute Circuit

This step is performed on Azure.

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-prerequisite-1.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=8ddd748d5a2296364a970cfe87966482" alt="Azure Prerequisite 1" width="1600" height="517" data-path="assets/images/vxc-azure-prerequisite-1.png" />

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-prerequisite-2.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=9f17c8a25c30af49c9436faaed7cf3bb" alt="Azure Prerequisite 2" width="1305" height="1600" data-path="assets/images/vxc-azure-prerequisite-2.png" />

| Parameter        | Value                                                          |
| ---------------- | -------------------------------------------------------------- |
| Region           | Choose the matching available region from the VXC coverage API |
| Port Type        | Provider                                                       |
| Provider         | Equinix                                                        |
| Peering location | matching available region from the VXC coverage API            |
| Bandwidth        | Choose the available bandwidth from the VXC coverage API       |
| SKU              | Standard                                                       |

Choose the rest of the parameters at your own discretion.

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-prerequisite-3.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=94aae5e58ffa4f667349cde600497342" alt="Azure Pre-requisite 3" width="1600" height="692" data-path="assets/images/vxc-azure-prerequisite-3.png" />

At the end of this step, the “Provider status” should say “Not provisioned”.

### Telnyx Network

This step is performed on Telnyx.

If you don't have a network created already, you may follow [this guide](https://developers.telnyx.com/docs/network/networks) to create one.

## Procedure

### Create a VXC resource

This step is performed on Telnyx.

```http request theme={null}
POST /v2/virtual_cross_connects HTTP/1.1
Host: api.telnyx.com
Content-Type: application/json
Authorization: Bearer XXX
Content-Length: 286

{
    "network_id": "{{you network UUID}}",
    "name": "my-first-azure-vxc",
    "cloud_provider": "azure",
    "cloud_provider_region": "Frankfurt",
    "primary_cloud_account_id": "xxxxxx",
    "bgp_asn": 12076
}
```

| Parameter                  | Value                                                    |
| -------------------------- | -------------------------------------------------------- |
| `cloud_provider`           | `azure`                                                  |
| `cloud_provider_region`    | Choose the matching region from the ExpressRoute circuit |
| `primary_cloud_account_id` | "Service key" on the ExpressRoute created previously     |
| `bgp_asn`                  | Azure’s bgp asn which is 12076                           |

Take note of the following info in the response; you will need it later.

* `id`
* `primary_cloud_ip`
* `primary_bgp_key`

### Enable Primary Connection

This step is performed on Telnyx.

```http request theme={null}
PATCH /v2/virtual_cross_connects/:vxc_uuid HTTP/1.1
Host: api.telnyx.com
Content-Type: application/json
Authorization: Bearer XXX
Content-Length: 31

{
    "primary_enabled": true
}
```

You must make sure the VXC `status` is `provisioned` before proceeding to the next step. You can poll the status using GET request on the specific VXC.

### Azure Private Peering

This step is performed on Azure.

“Provider status” must show “Provisioned” before performing this step.

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-private-peering-1.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=e3a5a7d7efeb11973cda69733f69ff17" alt="Azure Private Peering 1" width="1600" height="695" data-path="assets/images/vxc-azure-private-peering-1.png" />

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-private-peering-2.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=836fbc4e6b6beb6a3d1d8db16b3d7e80" alt="Azure Private Peering 2" width="1600" height="693" data-path="assets/images/vxc-azure-private-peering-2.png" />

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-private-peering-3.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=4cd2b9028296ae3dcc9c2d729cad6519" alt="Azure Private Peering 3" width="1439" height="1600" data-path="assets/images/vxc-azure-private-peering-3.png" />

| Parameter             | Value                                                 |
| --------------------- | ----------------------------------------------------- |
| Peer ASN              | Telnyx’s BGP ASN which is 63440                       |
| Subnets               | IPv4                                                  |
| IPv4 Primary subnet   | Choose the /30 block that includes `primary_cloud_ip` |
| IPv4 Secondary subnet | Choose the next /30 block                             |
| VLAN ID               | Choose any number from a valid VLAN range             |
| Shared key            | primary bgp key                                       |
| Public IP address     | Create new                                            |
| Public IP address SKU | Standard                                              |

After saving, you may need to wait for some time before performing the next step.

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-private-peering-4.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=7791fa834653dd9241ed07ddd4389794" alt="Azure Private Peering 4" width="1600" height="677" data-path="assets/images/vxc-azure-private-peering-4.png" />

At this point, you should see Telnyx IPs advertised in the result after you click into “View route table.”

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-private-peering-5.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=5fa05db94d71a0a9503633632ba31458" alt="Azure Private Peering 5" width="1600" height="319" data-path="assets/images/vxc-azure-private-peering-5.png" />

At this point, you are all set. Perform the following steps only if you are trying to test things out before putting it into your own production environment.

### Virtual Network

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-virtual-network-1.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=266e753e977e245fcfd816f3d9ebc5f5" alt="Azure Virtual Network 1" width="1328" height="1600" data-path="assets/images/vxc-azure-virtual-network-1.png" />

| Parameters | Value                                                            |
| ---------- | ---------------------------------------------------------------- |
| Region     | Match that of the virtual network created from the previous step |

Next, add a Gateway subnet. Keep all parameters as default.

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-virtual-network-2.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=d96123cbfbe35878b5dc02a6afcbf4d0" alt="Azure Virtual Network 2" width="1600" height="761" data-path="assets/images/vxc-azure-virtual-network-2.png" />

### Virtual Network Gateways

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-virtual-network-gateways-1.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=89670eea57fb63a959010cdf9142b43e" alt="Azure Virtual Network Gateways 1" width="1318" height="1600" data-path="assets/images/vxc-azure-virtual-network-gateways-1.png" />

| Parameters            | Value                                                            |
| --------------------- | ---------------------------------------------------------------- |
| Name                  | Something meaningful to you                                      |
| Region                | Match that of the virtual network created from the previous step |
| Gateway type          | Express Route                                                    |
| SKU                   | Standard                                                         |
| Virtual network       | Choose the one created from the previous step                    |
| Public IP address     | Create new                                                       |
| Public IP address SKU | Standard                                                         |

The gateway creation will take a while; upward of 20 minutes. In the meantime, you can proceed to the following step.

### Virtual Machines

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-virtual-machines-1.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=f2002b35fd2d0fb334de48c9d4d130db" alt="Azure Virtual Machines 1" width="1348" height="1600" data-path="assets/images/vxc-azure-virtual-machines-1.png" />

| Parameters | Value                                                            |
| ---------- | ---------------------------------------------------------------- |
| Region     | Match that of the virtual network created from the previous step |

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-virtual-machines-2.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=4a7543e92046ec9d17b1d91322b05069" alt="Azure Virtual Machines 2" width="1349" height="1600" data-path="assets/images/vxc-azure-virtual-machines-2.png" />

| Parameters      | Value                                         |
| --------------- | --------------------------------------------- |
| Virtual network | Choose the one created from the previous step |

You can keep the rest default or choose at your discretion.

### Add Gateway Connection

This step is performed on Azure.

The Virtual Gateway you created must be successfully deployed before this step is performed.

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-add-gateway-connection-1.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=995a2ca6d209ae766eee86dca0a6ea19" alt="Azure Add Gateway Connection 1" width="1600" height="730" data-path="assets/images/vxc-azure-add-gateway-connection-1.png" />

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-add-gateway-connection-2.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=bf069dc939d7dcbfa53cb3f348514d7a" alt="Azure Add Gateway Connection 2" width="1312" height="1600" data-path="assets/images/vxc-azure-add-gateway-connection-2.png" />

| Parameters      | Value         |
| --------------- | ------------- |
| Connection type | Express Route |

<img src="https://mintcdn.com/telnyx/v2FpkbJg6PQ53qHU/assets/images/vxc-azure-add-gateway-connection-3.png?fit=max&auto=format&n=v2FpkbJg6PQ53qHU&q=85&s=6e65d0e9d7949eba6abf9ee4158c031a" alt="Azure Add Gateway Connection 3" width="1308" height="1600" data-path="assets/images/vxc-azure-add-gateway-connection-3.png" />

| Parameters              | Value                                         |
| ----------------------- | --------------------------------------------- |
| Virtual network gateway | Choose the one created from the previous step |
| ExpressRoute circuit    | Choose the one created from the previous step |
| Routing weight          | 0                                             |

### Validate Connection

This step is performed on Azure.

Ensure all of the following are successfully deployed:

* ExpressRoute
* Virtual network
* Virtual network gateway & connection
* Virtual machine

SSH into the VM and perform a traceroute to sip.telnyx.com and sip.telnyx.eu. You can see the next hop is the next hop indicated on the Azure Private Peering under the express route.

<img src="https://mintcdn.com/telnyx/3V9ZqG7E0tiZSD47/assets/images/vxc-azure-verify-connection.png?fit=max&auto=format&n=3V9ZqG7E0tiZSD47&q=85&s=3304868d171f9ef3a8e3a726eb067c96" alt="Azure Validate Connection" width="1064" height="502" data-path="assets/images/vxc-azure-verify-connection.png" />
