See how easily you can connect FastConnect and Express Route using Ansible

October 5, 2021 | 3 minute read
Flavius Dinu
DevOps Lead
Text Size 100%:

Co-authored by Gabriel Feodorov.

Oracle and Microsoft established an enhanced cloud collaboration to create the best option to run enterprise solutions for their joint customers. To take advantage of this partnership, you need connectivity between the two clouds.

The most important components, you need to create: An Azure ExpressRoute and a virtual circuit for FastConnect that uses the Azure ExpressRoute. Establishing this connectivity can be challenging and you can encounter problems if you’re not following the necessary steps in order.

This blog post helps with making the connectivity and helps in deleting it in the right order to avoid consumption.


You can download the code from our site. Before running the code, you need a compartment and a dynamic routing gateway in OCI and a resource group and virtual network in Azure. Also, install the following components:

The root directory contains the following files:

  • fastexpress.ini: The inventory file in which you populate your variables

  • fastexpress.yaml: In charge of creating the connection

  • fastexpressdelete.yaml: In charge of deleting the connection

Preparing the inventory file

To prepare the inventory file (fastexpress.ini) we must first understand what arguments we need and what they’re doing.

The following resources already exist:

  • oci_compartment_id: ID of the existing compartment

  • oci_drg_id: The id of the existing DRG

  • oci_region: The region in which the DRG resides

  • azure_resource_group: The name of the resource group

  • azure_location: The location of the resource group

  • azure_virtual_network: The resource ID of the existing Azure virtual network

  • oci_peering_location: The location in Azure in which the peering occurs

We create the following resources:

  • oci_bw_shape_name: Shape of the bandwidth for the OCI virtual circuit (1–10 Gbps)

  • oci_vc_name: The name of the virtual circuit

  • azure_er_name: The name of the express route

  • azure_bw_in_mbps: The bandwidth in mbps of the Azure express route (50 Mbps, 100 Mbps, 200 Mbps, 500 Mbps, 1 Gbps, 2 Gbps, 5 Gbps, 10 Gbps)

  • azure_tier: The tier of the ExpressRoute (Basic, local, standard, or premium)

  • azure_family: The family of the ExpressRoute (MeteredData or UnlimitedData)

  • azure_vng_name: The name of the Azure virtual network gateway

  • azure_vng_sku: The SKU of the Azure virtual network gateway (VpnGw1, VpnGw2, VpnGw3, standard, or basic high performance)

  • azure_ip_config_name: The name of the IP config in Azure

  • azure_public_ip_address_name: The name of the public IP in Azure

Now that we know what values we provide in the inventory file, let’s populate it according to their description. In the end, the file looks similar to the following code block:

oci_bw_shape_name="1 Gbps"


oci_peering_location="Washington DC"


Running the code

To create the connection, go to the root directory and run the following command:

ansible-playbook -i fastexpress.ini fastexpress.yaml

In less than 10 minutes, all the resources are deployed and the connection is successfully established.

If you want to delete the connection, run the following command:

ansible-playbook -i fastexpress.ini fastexpressdelete.yaml

Again, in less than 10 minutes, all the resources are deleted and the connection is removed.


By populating only an inventory file, you can create a connection between OCI FastConnect and Azure ExpressRoute. Using this Ansible automation, you avoid many unnecessary problems that you face if you did it manually.

For more information on this topic, check out Step-by-Step Guide: Interconnecting Oracle Cloud Infrastructure and Microsoft Azure.

Flavius Dinu

DevOps Lead

Previous Post

UniQreate scales intelligent data extraction product on OCI and saves 20% monthly

Savita Raina | 7 min read

Next Post

Integra LifeSciences enhances multicloud capability with OCI, achieves 90% time savings and boosts IT efficiency

Akshai Parthasarathy | 12 min read