Note:

QuickStart Oracle Database@Azure with Terraform or OpenTofu Modules

Introduction

Oracle Database@Azure is an Oracle Database service running on Oracle Cloud Infrastructure (OCI), co-located in Microsoft data centers, empowering you to use Oracle Database services with fastest connection to Azure resources. The multicloud onboarding involves multiple steps navigating between OCI and Microsoft Azure portal. This tutorial explains how to streamline the provision process by leveraging our reference implementation of Terraform or OpenTofu modules and templates, available in the GitHub repository of OCI multicloud landing zone for Microsoft Azure: terraform-oci-multicloud-azure.

Provision Process

Once you have completed the service purchase, you can start simplifying the provision process with Terraform or OpenTofu.

There are multiple steps an organization must perform to purchase, configure, and use the service in their Azure environment. Depending on your organization’s Azure configuration, policies, and procedures you may use some or all of the steps outlined in the figure below. The diagram below illustrates opportunities for Terraform or OpenTofu to simplify the provisioning process, eliminating manual steps performed in the Azure Portal and OCI Console.

Provisioning Process

To get a quickstart with using the Terraform templates and modules, typically you will have to go through these high level tasks.

Objectives

Prerequisites

Task 1: Fork and Clone the GitHub repository

Clone the terraform-oci-multicloud-azure repository and navigate to the appropriate template directory to get started. Alternatively, you can fork it first, which allows you to sync your copy with our latest updates later, or optionally contribute your updates via through a pull request.

Task 2: Initialize Terraform

Run terraform init or tofu init in your terminal to setup the local Terraform environment. Alternatively, you can configure Terraform with remote state by refer to documentations from Terraform, OCI or Azure for further details.

Task 3: Configure the Required Terraform Variables

Each template directory contains a terraform.tfvars.template file makes it easy for you to populate the required input variables. You can leverage it to construct your own variable definition file (for example, terraform.tfvars), or alternatively make use of other methods (for example, environment variables with TF_VAR_ prefix, or terraform CLI with -var parameters ) to setup the required variables.

Task 4: Authenticate to Azure and OCI

Some of the terraform templates leverage both OCI and Azure terraform providers, you must login to each environment before provisioning.

Task 5: Review and Apply the Terraform Plan

After configuring your variables and authentication, run terraform plan or tofu plan to review the changes. Once you are satisfied with the plan, proceed by running terraform apply or tofu apply to provision the configurations.

Terraform Templates

The following table outlines the available Terraform templates, describes what they do and which Terraform Provider they rely on. You can use them individually according to your situation, and you can further customise them with OCI Landing Zone and Azure Verified Modules (AVM) for a more complex setup. For more information about Microsoft and HashiCorp’s joint guidance usage scenarios of AzureRM and AzAPI, see Unlocking the Best of Azure with AzureRM and AzAPI Providers.

Exadata and Autonomous Database

Oracle Database@Azure AzureRM AzAPI
Exadata Quickstart Exadata with OCI Landing Zone Modules (azurerm-oci-exadata-quickstart) Quickstart Exadata with Azure Verified Modules (avm-oci-exadata-quickstart)
Autonomous Database Quickstart Autonomous Database with AzureRM (azurerm-oci-adbs-quickstart) Quickstart Autonomous Database with AzAPI (az-oci-adbs)

Identity

Next Steps

This tutorial explained how you can use Terraform or OpenTofu in provisioning Oracle Database@Azure services. See the Related Links section for details about Oracle Database@Azure, automation effort, and more.

Let us know if you have any feature or enhancement request by creating a GitHub issue on our repository or engage with our OCI Multicloud Forum. We are eager to support your use case every step of the way.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.