Creating a private link between OCI and Azure part two | connecting an Azure VM with an OCI Autonomous Database

In previous post we explained how to create a circuit between OCI and Azure. Today we are finishing the example by creating a database in OCI and installing an Oracle Instantclient in an azure VM to run sql against the database throughout the connection. Here we are the diagram, there are a lot of pieces in there but, thanks to the cloud paradigm, the job is pretty much straightforward.

Here a table with the networking address spaces and concepts involved in the link:

SUBNETS10.0.1.0/24 PRIVATE11.0.0.0/24 PUBLIC
AZURE SIDEVM with public IP
BGP IP’s10.0.2.21/30

Hands on!

1. Create a virtual network in Azure with a public subnet in it

A VNET is the name in Azure for a software defined network.

2. Create virtual machine in azure

The VM gets created

3. Create VCN in OCI WITH a private subnet in it

A VCN is the name in OCI for a software defined network.

VCN gets created

4. create an autonomous database in the VCN

An autonomous database is a powerful but simple way to deploy an relational, JSON, REST enabled, fault tolerant, resilient Oracle database that can be created in couple of minutes and be inflated/deflated with no loss of service depending on your needs.

ATP database gets created. Grab the private endpoint IP of the database

5. go to the ExpressRoute CIRCUIT created and review the status

Verify that link is enabled

6. Go to FastConnect CONNECTION and review status

Verify that BGP IP status is up

Take a look to the BGP addresses configured, they must be /30 and not overlapping neither Azure virtual network nor OCI vcn

7. create route table for the oci private subnet

Configure a route to send the traffic with destination azure virtual network through the OCI DRG

8. open port 1522 in security list of private subnet in OCI

9. Create virtual network gateway in azure

VNG in Azure is like DRG in OCI

10. Create a connection in the azure expressroute CIRCUIT

The connection in Azure is similar to VCN association to DRG in OCI

ssh to azure vm and telnet ip database port 1522

Get the Oracle database instanclient distribution files. Unzip them. Get the database wallet from the ATP details in OCI portal. Put the wallet in instantclient_21_1/network/admin directory and unzip it

Watch the content of the tnsadmin.ora and grab the fqdn of the database. Put the entry in the /etc/hosts file associated with the ip of the database (this is because we haven’t configurad DNS resolution so far

The azure VM is Ubuntu:

Therefore, I execute the following to get it working:

export LD_LIBRARY_PATH=/home/azureuser/instantclient_21_1
sudo apt-get install libaio1
export TNS_ADMIN=/home/azureuser/instantclient_21_1/network/admin
cd /home/azureuser/instantclient_21_1

Finally execute sqlplus, remember the password of the admin user you put when database was created

./sqlplus admin@atp_high
And that’s it, we are connected to the database from Azure, hope it helps!! 🙂

By the way, this is the latency observed between Azure VM and a VM created in OCI subnet (for a circuit limited to 50 Mbits in Azure side/1Gbit in OCI side):

And vice versa:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.