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

# Creating an Azure Connection for an MVE with Versa Secure SD-WAN

> This help topic describes how to create a VXC from an MVE to Microsoft Azure ExpressRoute and integrate the connection with Versa Secure SD-WAN.

export const Anchor = ({name}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Anchor -';
  if (name === undefined || name === null || name === 'undefined') {
    console.error(`${errorPrefix} \`name\` must have a value — rendering an empty string instead`);
    return <></>;
  }
  const raw = typeof name === 'string' ? name : JSON.stringify(name);
  const id = raw.replace(/\s+/g, '-').replace(/[^A-Za-z0-9_-]/g, '').replace(/-+/g, '-').replace(/^-+|-+$/g, '');
  if (!id) {
    console.error(`${errorPrefix} \`name\` "${name}" sanitizes to an empty id — rendering an empty string instead`);
    return <></>;
  }
  return <a style={{
    scrollMarginTop: 'var(--scroll-mt)'
  }} id={id}></a>;
};

export const Gloss = ({term, anchor, langDir = 'en'}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Gloss -';
  if (typeof term !== 'string') {
    term = String(term);
  }
  if (typeof anchor !== 'string') {
    anchor = String(anchor);
  }
  if (!term || term === 'undefined') {
    console.error(`${errorPrefix} the \`term\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (!anchor || anchor === 'undefined') {
    console.error(`${errorPrefix} the \`anchor\` property is required — rendering an empty string instead`);
    return <></>;
  }
  const lang = langDir === 'en' ? '/' : '/' + langDir + '/';
  const glossaryPage = lang + 'glossary/#' + anchor;
  return <a href={glossaryPage}>{term}</a>;
};

export const Image = ({src, alt = '', caption, width, height, shadow}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Image -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  const img = <img className={['mega-image-style', shadow ? 'shadow' : ''].join(' ')} src={src} alt={alt} width={width} height={height} style={{
    display: 'block'
  }} />;
  return caption ? <figure>
      {img}
      <figcaption style={{
    textAlign: 'center',
    width
  }}>{caption}</figcaption>
    </figure> : img;
};

export const InlineImage = ({src, alt, height = 16, shadow, width}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: InlineImage -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  if (typeof alt !== 'string') {
    alt = String(alt);
  }
  if (alt === 'undefined') {
    console.error(`${errorPrefix} \`alt\` is required (use "" for decorative images) — rendering an empty string instead`);
    return <></>;
  }
  if (height) {
    height = height.toString().replaceAll(/\D/g, '');
  }
  if (width) {
    width = width.toString().replaceAll(/\D/g, '');
  }
  return <img className={['inline-icon', shadow ? 'shadow' : null, 'm-0'].filter(Boolean).join(' ')} src={src} alt={alt} height={height} width={width} style={{
    display: 'inline',
    verticalAlign: 'middle',
    maxHeight: height ? `${height}px` : undefined,
    maxWidth: width ? `${width}px` : undefined,
    height: height ? `${height}px` : undefined,
    width: width ? `${width}px` : undefined
  }} />;
};

export const Link = ({href, children}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Link -';
  if (typeof href !== 'string') {
    href = String(href);
  }
  if (!href || href === 'undefined') {
    console.error(`${errorPrefix} the \`href\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (href.includes('{') || href.toUpperCase().includes('%7B')) {
    console.error(`${errorPrefix} could not resolve a variable in href "${href}" — rendering an empty string instead`);
    return <></>;
  }
  const isExternal = (/^https?:\/\//).test(href);
  return <a href={href} className="link" target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noreferrer' : undefined}>
      {children ?? href}
      {isExternal && <span className="sr-only"> (opens in a new tab)</span>}
    </a>;
};

You can create a network connection from an MVE (a Versa Controller) to Azure ExpressRoute with Virtual Cross Connects (VXCs). You can create either a private connection or a public (Microsoft) connection.

<Callout icon="triangle-exclamation" color="red">
  Before you begin, create an MVE in Versa Director. For more information, see [Creating an MVE Integrated with Versa](/mve/versa/creating-mve).
</Callout>

There are three parts to adding an ExpressRoute connection to your MVE and Versa SD-WAN.

1. Set up your ExpressRoute plan and deploy the ExpressRoute circuit in the Azure console. When deployed, you get a service key. For additional details, see the Microsoft [ExpressRoute documentation](https://docs.microsoft.com/en-us/azure/expressroute/).

   To check the latency and price of connecting to a particular Azure Partner location, start the procedure to [add a connection to Microsoft Azure](#azure-vxc) but instead of providing a **Microsoft Azure Service Key**, click **View all Azure Partner locations**. You can proceed to the Connection Details page without a service key and review the pricing of the selected port. To place an order for a Microsoft Azure connection, you need to provide a service key.
   　　　　<Image src="/images/snippets/cloud/connections/azure-new-conn-all-locations.png" alt="The new connection 'Select Port' page with the Microsoft Azure Provider selected. A list of ports are shown, with their location, zone, and expected latency" shadow={true} width={600} />

2. In the Megaport Portal, create a connection (VXC) from your MVE to your ExpressRoute location.

3. In Versa Director, create a new interface and add the details of the ExpressRoute connection.

The instructions in this topic describe the second and third parts.

<Note>
  MVE for Versa SD-WAN requires configuration steps in both Versa Director and the Megaport Portal for all cloud connections.
</Note>

## Adding the ExpressRoute connection in the Megaport Portal

To set up the ExpressRoute connection, you need to create the connection in the Megaport Portal.

<Anchor name="azure-vxc" />

**To create a connection to ExpressRoute from the Megaport Portal**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page and select the MVE you want to use.

2. Click **+Connection** on the MVE.
   <Image src="/images/cloud/mve/add-connection.png" alt="Add connection" shadow={true} width={700} />

3. Click the **Cloud** tile.

4. Select Microsoft Azure as the provider.
   <Image src="/images/cloud/azure/azure-new-connection.png" alt="The new connection 'Select Port' page with the Microsoft Azure Provider selected" shadow={true} width={700} />

5. Add the ExpressRoute service key into the **Microsoft Azure Service Key** field.\
   The Portal verifies the key then displays the available port locations based on the ExpressRoute region. For example, if your ExpressRoute service is deployed in the Australia East region in
   Sydney, you can select the Sydney locations.

6. Select the connection point for your first connection.\
   To deploy a second connection (and this is recommended), you can create a second VXC - enter the same service key and select the other connection location.

   Some helpful links appear on the configuration screen to resources including the Azure Resource Manager console and some tutorial videos.

7. Click **Next**.

8. Specify the connection details:

   * **Connection Name** -- The name of your VXC to be shown in the <Link href="https://portal.megaport.com">Megaport Portal</Link>.

   * **Service Level Reference** (optional) -- Specify a unique identifying number for your Megaport service to be used for billing purposes, such as a cost center number, unique customer ID, or purchase order number. The service level reference number appears for each service under the Product section of the invoice. You can also edit this field for an existing service.

   * **Rate Limit** -- The speed of your connection in Mbps. The rate limit for the VXC will be capped at the maximum allowable based on the ExpressRoute service key.

   * **VXC State** -- Select **Enabled** or **Shut Down** to define the initial state of the connection. For more information, see [Shutting Down a VXC for Failover Testing](/connections/shut-down-vxc).

     <Note>
       If you select **Shut Down**, traffic will not flow through this service and it will behave as if it was down on the Megaport network. Billing for this service will remain active and you will still be charged for this connection.
     </Note>

   * **A-End vNIC** -- Select an A-End vNIC from the drop-down list. For more information about vNICs, see  [Creating an MVE in the Megaport Portal](/mve/versa/creating-mve#creating-mve).

   * **Preferred A-End VLAN** (optional) -- Specify an unused VLAN ID for this connection (for ExpressRoute this is the S-Tag). This must be a unique VLAN ID on this MVE and can range from 2 to 4093. If you specify a VLAN ID that is already in use, the system displays the next available VLAN number. The VLAN ID must be unique to proceed with the order. If you don't specify a value, Megaport will assign one.

   * **Minimum Term** -- Select No Minimum Term, 12 Months, 24 Months, 36 Months, 48 Months, or 60 Months. Longer terms result in a lower monthly rate. *12 Months* is selected by default. Take note of the information on the screen to avoid early termination fees (ETF).

     Enable the [Minimum Term Renewal](/portal-admin/auto-renew/#auto-renew) option for services with a 12, 24, 36, 48 or 60-month term to automatically renew the contract at the same discounted price and term length at the end of the contract. If you don't renew the contract, at the end of the term,  the contract will automatically roll over to month-to-month contract for the following billing period, at the same price, without term discounts.

     For more information, see [VXC Pricing and Contract Terms](/finance/vxc-pricing) and [VXC, Megaport Internet, and IX Billing](/finance/billing-details).

   * **Resource Tags** -- You can use resource tags to add your own reference metadata to a Megaport service.\
     To add a tag:
     1. Click **Add Tags**.
     2. Click  **Add New Tag**.
     3. Enter details into the fields:
        * **Key** -- string maximum length 128. Valid values are a-z 0-9 \_ : . / \ -
        * **Value** -- string maximum length 256. Valid values are a-z A-Z 0-9 \_ : . @ / + \ - (space)
     4. Click **Save**.
        If you already have resource tags for that service, you can manage them by clicking **Manage Tags**.
     <Warning>
       Never include sensitive information in a resource tag. Sensitive information includes commands that return existing tag definitions and information that will identify a person or company.
     </Warning>

   * **Configure Single Azure Peering VLAN** -- By default, this option is enabled for MVE and we strongly recommend keeping it enabled with Versa SD-WAN.\
     This option provides a single tag VLAN solution. You configure peering in Azure with the MVE VLAN (A-End) and the peer VLAN set in Azure (B-End). Note, you can have only one peering type (Private or Microsoft) per VXC with this option.

     <Callout icon="triangle-exclamation" color="red">
       If you do not enable this option, the VXC appears active but it does not recognize traffic.
     </Callout>

   * **Azure Peering VLAN** -- This value needs to match the A-End VLAN for single tag VLAN peering. A different Azure peering VLAN can also be set, if required.

   <Image src="/images/cloud/mve/portal-create-mve-azure.png" alt="Azure connection details" shadow={true} width={550} />

9. Click **Next** to proceed to the connection detail summary, then click **Add VXC**.

10. Click **Review Order** to proceed through the checkout process, or click **Save** to save the configured services before placing the order.

11. Review the Important Information section and confirm agreement with the Service Agreements.

    If you do not have a promotion code, skip to the **Order Now** step. If you do have a promotion code, enter it into the **Enter discount code** field then click **Apply**. Alternatively, if a code already appears in the **Discounts** field, verify it is correct and click **Apply**.

    The promotional discount appears below the Standard Term discount.  This discount is not reflected in the Monthly Rate shown here, it is applied at the time of billing.  If an invalid or expired code causes an error with your order, contact your Megaport Account Manager for a replacement code.

    <Image src="/images/snippets/add-promo-code.png" alt="Add Promo Code" shadow={true} width={750} />

    If you entered an incorrect promotion code, you can remove it by clicking **Remove**.

    <Note>
      In addition to entering a promotion code manually, there are two other ways to apply promotion codes.

      * **Auto-apply** -- Megaport automatically applies the promotion code to your order. It appears automatically on the Checkout page.
      * **Manual list** -- Eligible promotion codes appear at checkout for any applicable services in your cart. You can then select and apply them.
    </Note>

12. Click **Order Now**.

When the VXC configuration completes, the VXC icon is green.

<Image src="/images/cloud/mve/versa/azure/azure-added-vxc.png" alt="New VXC" shadow={true} width={700} />

In the Azure Resource Management console, the provider status will be `Provisioned`.

<Image src="/images/cloud/mve/azure-provisioned.png" alt="Azure Provider Status" shadow={true} width={700} />

When provisioned, you need to configure peerings. You can configure private and Microsoft peering. Click the peer to configure and provide these details:

* **Peer ASN** -- Enter the ASN for the MVE.
* **IPv4 Subnets** -- From each of these subnets, MVE uses the first usable IP address and Microsoft uses the second usable IP for its router.
* **VLAN ID** -- Enter the A-End VLAN from the MVE. (Note, the VLAN ID in the Azure console can be different from the A-End VLAN.)
* **Shared Key** (optional) -- Enter an <Gloss term="MD5" anchor="md5" /> password for BGP.

<Image src="/images/cloud/mve/azure-peering.png" alt="Azure Peering Configuration" shadow={true} width={700} />

## Adding the ExpressRoute connection to Versa Director

After you create the connection from your MVE to Azure and set up the connection in the Azure console, you need to configure it in Versa Director. This involves creating an interface and configuring BGP settings, ASNs, VLANs, and MD5 values.

**To add the Azure Cloud connection in Versa Director**

1. Collect the connection details from the Azure console.\
   Display the details of the connection you created in Azure for this connection. Note the values for the **Peer ASN**, **Shared Key**, **VLAN ID**, and **IPv4 Primary Subnet**.

2. Collect the connection details from the Megaport Portal.\
   Click the gear icon <InlineImage src="/images/buttons/gear-icon.png" alt="Gear icon" /> for the Azure connection from your MVE and click the Details view.
   Note the value for the **A-End VLAN**.

3. Log in to Versa Director.

4. Select the **Workflows** tab in the top menu bar.

5. Select Template > Templates in the left menu bar.

6. Select the template associated with this device.

   <Image src="/images/cloud/mve/versa-choose-template.png" alt="Versa connection details" shadow={true} width={700} />

7. Select the **Interfaces** tab.

8. Under WAN Interfaces, click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to add a subinterface.

9. In the **VLAN ID** field, enter the VLAN value from the Megaport Portal.\
   Specify the A-End VLAN for the connection - click the details icon for the connection in the Portal to find this value.

10. In the Network Name column,  choose **+ Create WAN Network** from the menu.\
    Or select a previously created network, if appropriate.

11. For a new network, enter a name and optionally, a description.

12. Click **OK**.

13. In the IPv4 column, choose **Static** from the menu.

    <Image src="/images/cloud/mve/versa/azure/azure-director-subint.png" alt="Versa Subinterface" shadow={true} width={800} />

14. Select the **Routing** tab.

15. In the BGP section, select the network created earlier.

16. Enter in the following values for your connection:
    * **Local AS** -- The AS value for the A-End of the connection.
    * **Neighbor IP** -- The IP address of the Azure side of the connection. These values are available in the Azure console.  The IP addresses and CIDR appear in the **IPv4 Primary Subnet** field; MVE uses the first usable IP address and Azure uses the second usable IP for its router. For this field, enter the MVE (first usable) IP address.
    * **Peer AS** -- Enter the Azure-side ASN of 12076. This is a fixed value, and appears in the connection details on the Azure console.
    * Optionally, enable BFD.

17. Click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add).
    <Image src="/images/cloud/mve/versa/azure/azure-director-bgp-config.png" alt="Versa BGP settings" shadow={true} width={800} />

18. Click **Recreate** at the bottom of the page.\
    A screen appears that highlights the differences in the configuration.

19. Click **Deploy**.

20. Select the **Configuration** tab in the top menu bar.

21. Select Templates > Device Templates in the horizontal menu bar.
    <Image src="/images/cloud/mve/director-device-templates.png" alt="Director Device Templates" shadow={true} width={800} />

22. Click the template you want to modify.

23. In the side navigation, select Virtual Routers.
    <Image src="/images/cloud/mve/versa/azure/azure-director-virtual-router.png" alt="Director virtual router" shadow={true} width={800} />

24. Click the link for the subinterface network.

25. In the side navigation, select BGP.

26. Click the Instance ID for your network.
    <Image src="/images/cloud/mve/versa/azure/azure-director-bgp-tab.png" alt="BGP instance" shadow={true} width={600} />

27. Click <InlineImage src="/images/mve/versa/parameterize-icon.png" alt="Parameterize icon" /> (Parameterize) to use variables for the Router ID and the Password fields.\
    You can also parameterize Local AS and Peer AS fields - otherwise it will use the static values provided in earlier steps.

    <Note>
      Static Address is parameterized by default.
    </Note>

28. Click **OK** two times to return to the main window.

At this point, we have created the interface and next we need to configure the device and create the BGP session.

1. In Director, select the **Workflows** tab in the top menu bar.

2. Select Devices > Devices in the left navigation.
   <Image src="/images/cloud/mve/versa/azure/director-devices-devices.png" alt="Versa devices" shadow={true} width={800} />

3. Click the device to modify.

4. Select the **Bind Data** tab.

5. Enter the values for IPv4 Static Address, BGP Password, BGP Router ID, and Hop Address.\
   Other values, such as the Local and Peer AS are auto-populated from our earlier settings.
   * **Static Address** -- Enter the Customer IP address (your local IP address, including the mask value).
   * **Password** -- Add the BGP Auth information if you defined this in the Azure console. (This was optional.)
   * **BGP Router ID** --  Enter the Customer IP address (your local IP address, including the mask value) from the MVE details.
   * **Hop Address** - The IP address for the Azure side of the connection. Enter the second usable IP address from the **IPv4 Primary Subnet** from the Azure console.
     <Image src="/images/cloud/mve/versa/azure/versa-azure-bind-data.png" alt="Versa devices" shadow={true} width={800} />

6. Click **Deploy**.

7. In the upper right of the screen under your username, click **Commit Template**.

8. Select your **Organization** and **Template**.\
   In the lower part of the screen, the Template State will be OUT-OF-SYNC.

   <Image src="/images/cloud/mve/versa/versa-commit-template-device.png" alt="Commit Versa device" shadow={true} width={800} />

9. Click the eye icon in the Differences column.\
   A page appears that highlights the differences in the configuration.

10. If you are satisfied with the configuration, click **Commit to Device**.

## Validating your Azure connection

You can review device status, including the connection state, from the Monitor tab in Director.

1. Select the **Monitor** tab in the top menu bar.

2. Select Devices in the horizontal menu bar.

3. Click the device to review status and activity.
