Multicloud Oracle Database@Microsoft Azure - How to create & access Oracle Autonomous Database 23ai on Azure Cloud

Multicloud Oracle Database@Microsoft Azure - How to create & access Oracle Autonomous Database 23ai on Azure Cloud


Wishing you a Happy, Peaceful and Prosperous Deepavali (Diwali)

Thanks - Madhusudhan Rao , Family, Friends and my Oracle Team

Happy Diwali

In this article, we will see how to create an Oracle Autonomous Database @ Microsoft Azure Cloud. We will try the Azure Portal and The Azure Command Line Interface approaches to familiarize ourselves with both. There is a troubleshooting section for common errors that you might come across. Use Azure Copilot to help us debug errors, We will look deeper into the details of creating an Azure Resource Group, Azure virtual network, and Azure Delegated subnet Oracle.Database/network.attachment, Create Azure Public IP, Azure Windows Virtual Machine, List various images and Create Bastion Host. Once the environment is available, what are the various options to access these services? These include Data Studio, Microsoft .Net Core Project, Java and Python applications, and more. Multicloud opens up infinite opportunities to leverage the best of both the cloud worlds, Oracle Cloud OCI and Microsoft Azure.

Table of Contents

  1. Login to the Microsoft Azure portal
  2. Creating Oracle Database @ Microsoft Azure using Azure Portal
  3. Checking Error Logs, Messages and Troubleshooting using Copilot
  4. Login to Microsoft Azure using the Command line interface
  5. Working with Microsoft Azure Command Line Interface
  6. Creating an Azure Resource Group
  7. Creating an Azure Virtual Network and Subnet
  8. Creating Azure Network Public IP
  9. Create a Windows Virtual Machine (VM)
  10. Accessing Windows VM through RDP
  11. Create Oracle Autonomous Database @ Azure using Azure CLI


01. Login to the Microsoft Azure portal

How to Authenticate in to Azure Portal.

Start with this Login URL at https://portal.azure.com/

Azure login screen
Stay signed in
Use Microsoft Mobile Authenticator to Sign in

02. Creating Oracle Database @ Microsoft Azure using Azure Portal

Use Azure Portal to create Oracle Database @ Azure, Search for Oracle Database@Azure

You can create an Oracle Autonomous Database Service or Oracle Exadata Database. Click on Oracle Autonomous Database Service in the left navigation. (Direct Link)

Click on + Create button

Choose your Subscription details, and select or create a new resource group

Select workload type Data Warehouse or Transaction Processing or JSON or APEX

Choose Database Version 19c or 23ai

Provide Database ADMIN password

Choose Backup retention period in days

You might have an option to use a Private Network Only or use a Public Network. Please check with your administrator. The below screen shows a case of private network access.

This shows secure access from allowed IP addresses or access from everywhere - network settings

This will bring us to Review + Create Screen

This will take us to the deployment screen or the Autonomous Database creation screen.

If Deployment is successful, it will change from provisioning state to Available or Failed, as shown below.


03. Checking Error Logs, Messages and Troubleshooting using Copilot

- Failed to create ADB

Check the Error logs if you have access to Provision ADB on Azure; there is a possibility that you can create a resource group, network, subnet, etc. but not be able to create ADB - please check on your subscription and if you are part of Group with an access to create ADB

If the status is available, then we can proceed with connecting with the Database. If not, check the error logs; it also provides error logs in JSON format

- Troubleshooting No Subscription Message

Instead of Azure Mobile Authenticator, if you use any other organisation-specific authenticator, you may be able to log into the Azure Cloud, but you will not be able to access Oracle Database or any other Azure Cloud services. you will see a No subscription message.

Please ensure that you are using Azure Mobile Authenticator and Not your Organization Specific Authenticator, remember your Organization can also have some of Azure Subscriptions like Sharepoint, Office etc. which means that you will be authenticated but not authorized to create Oracle Database or any of the other cloud resources (Like VMs,Networks etc).

- Using Copilot & Azure Cloud console to troubleshoot

If you come across Deployment failed error messages, then use Help me troubleshoot

This will lead us to Copilot chatbot which gives us various commands to trouble shoot and also open a cloud shell if you want to run any of the Azure commands listed below.

Below is an example of running cloud shell (power shell) to troubleshoot installation or deployment.

Get-AzResourceGroupDeploymentOperation -ResourceGroupName ind-adb-rg-oracle -Name ExampleDeployment | Where-Object { $_.ProvisioningState -eq "Failed" }        

Troubleshooting the wrong image while creating an Azure VM

If your image submitted does not match the available images you will get the Error message as shown below

Invalid image "2022-datacenter-azure-edition-core". Use a valid image URN, custom image name, custom image id, VHD blob URI, or pick an image from ['CentOS85Gen2', 'Debian11', 'OpenSuseLeap154Gen2', 'RHELRaw8LVMGen2', 'SuseSles15SP5', 'Ubuntu2204', 'Ubuntu2404', 'Ubuntu2404Pro', 'FlatcarLinuxFreeGen2', 'Win2022Datacenter', 'Win2022AzureEditionCore', 'Win2019Datacenter', 'Win2016Datacenter', 'Win2012R2Datacenter', 'Win2012Datacenter'].
See vm create -h for more information on specifying an image.        

Solution - Please check the Create VM Section below, on how to list the available Images.


04. Login to Microsoft Azure using Command line interface

Download Azure Command Line interface and Install following the instructions for your operating system.

For example Mac OS

brew update && brew install azure-cli        

for Linux

sudo apt-get update
sudo apt-get install azure-cli        

Read Azure CLI concepts

Login to Azure

madhusudhanrao@MadhuMac AzureCloud % az login        

On Successful login, your web browser should open, authenticate, authenticate with Azure mobile app and then see the following results on command line interface

A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

Retrieving tenants and subscriptions for the selection...
The following tenants don't contain accessible subscriptions. Use `az login --allow-no-subscriptions` to have tenant level access.
4e2c6054-XX-XXXX-XX9705aca71b  

[Tenant and subscription selection]

No     Subscription name    Subscription ID                                    Tenant
-----  -------------------  ------------------------------------  ---------
[1] *  xxxxx                           99d4fb0e-XXXXXXd03db9025          xxxxxx        

List Account Details

az account list        

Response will be shown below

[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "e63de8-XXXX-XXX0863da5d",
    "id": "99d4fb0e-XXXX-XXXXdb9025",
    "isDefault": true,
    "managedByTenants": [],
    "name": "XXXX",
    "state": "Enabled",
    "tenantDefaultDomain": "XXXX.onmicrosoft.com",
    "tenantDisplayName": "XXXX",
    "tenantId": "e63de867-XXXX-e90c0863da5d",
    "user": {
      "name": "madhusudhan.rao-*",
      "type": "user"
    }
  }
]        

05. Working with Microsoft Azure using Command Line Interface

The Azure CLI is available to install in Windows, macOS and Linux environments. It can also be run in a Docker container and Azure Cloud Shell.
The Azure Command-Line Interface (CLI) is a cross-platform command-line tool to connect to Azure and execute administrative commands on Azure resources. It allows the execution of commands through a terminal using interactive command-line prompts or a script.
For interactive use, you first launch a shell such as cmd.exe on Windows, or Bash on Linux or macOS, and then issue a command at the shell prompt. To automate repetitive tasks, you assemble the CLI commands into a shell script using the script syntax of your chosen shell, and then you execute the script.

To Create an Autonomous Database @ Azure Cloud using the Azure command line interface, we would basically need the following resources already created.

Prerequisites

  • Access to Microsoft Azure cloud, OCI tenancy, and Oracle Database@Azure.
  • An Azure resource group.
  • An Azure Virtual Network (VNET) within your resource group.
  • A subnet within your VNET that is delegated to the Oracle.Database/networkAttachments service.

Let us see how we create some of these prerequisites in next few sections of this article using Azure CLI


06. Creating a Resource Group using Azure CLI

What is a Azure resource group

A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to add resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.
 az group create --name <resource-group-name> --location <resource-region>        

example

az group create --name ind-adb-rg-oracle --location eastus        

This will print an output on the console as shown below in JSON format

{
  "id": "/subscriptions/99d4fb0e-XXX-XXX-XX025/resourceGroups/ind-adb-rg-oracle",
  "location": "eastus",
  "managedBy": null,
  "name": "ind-adb-rg-oracle",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}        

Reality Check on Azure Portal

Resource Group

07. Creating a Azure Virtual Network and Subnet

What is Azure Virtual Network?

Azure Virtual Network is a service that provides the fundamental building block for your private network in Azure. An instance of the service (a virtual network) enables many types of Azure resources to securely communicate with each other, the internet, and on-premises networks. These Azure resources include virtual machines (VMs).

To create a network, replace the <resource-group>, <new-network-name> and <new-subnet-name> in the below AZ CLI command

az network vnet create \
    --name <new-network-name> \
    --resource-group <resource-group> \
    --address-prefix 10.0.0.0/16 \
    --subnet-name <new-subnet-name> \
    --subnet-prefixes 10.0.0.0/24        

For example -

az network vnet create \
    --name ind-retail-vnet-1 \
    --resource-group ind-adb-rg-oracle \
    --address-prefix 10.0.0.0/16 \
    --subnet-name subnet-1 \
    --subnet-prefixes 10.0.0.0/24        

This will return a success message

Reality check on Azure Portal (Search for Virtual Network)

Check for Subnet created

Check the subnet details by clicking on the edit icon

Check Subnet Details

08. Creating Azure Network Public IP

What is Azure public IP address?

Azure provides a default outbound access IP for VMs that either aren't assigned a public IP address or are in the backend pool of an internal basic Azure load balancer. The default outbound access IP mechanism provides an outbound IP address that isn't configurable.

The default outbound access IP is disabled when one of the following events happens:

  • A public IP address is assigned to the VM.
  • The VM is placed in the backend pool of a standard load balancer, with or without outbound rules.
  • An Azure NAT Gateway resource is assigned to the subnet of the VM.

Replace <resource-group-name>, <new-public-ip> and <Region>

az network public-ip create \
    --resource-group <resource-group-name> \
    --name <new-public-ip> \
    --sku Standard \
    --location <Region> \
    --zone 1 2 3        

for example -

az network public-ip create \
    --resource-group ind-adb-rg-oracle \
    --name ind-public-ip \
    --sku Standard \
    --location eastus2 \
    --zone 1 2 3        

This will return us a public Ip address.

Create a Public IP

08. Create Azure Bastion Subnet

What is Azure Bastion?

Azure Bastion uses your browser to connect to VMs in your virtual network over Secure Shell (SSH) or Remote Desktop Protocol (RDP) by using their private IP addresses. The VMs don't need public IP addresses, client software, or special configuration.

Replace <resource-group> and <network-name>

az network vnet subnet create \
    --name AzureBastionSubnet \
    --resource-group <resource-group> \
    --vnet-name <network-name> \
    --address-prefix 10.0.1.0/26        

for example

az network vnet subnet create \
    --name AzureBastionSubnet \
    --resource-group ind-adb-rg-oracle \
    --vnet-name ind-retail-vnet-1 \
    --address-prefix 10.0.1.0/26        

Reality Check

Create a Bastion Host

You can create Network for Bastion as

az network bastion create \
    --name bastion \
    --public-ip-address public-ip \
    --resource-group test-rg \
    --vnet-name vnet-1 \
    --location eastus2        

09. Create a Windows Virtual Machine (VM)

Sometimes you want to create a Windows VM and access your Oracle Database on private network using a Bastion Host through a Windows RDP.

So let us see how we can create a Windows VM on Azure Cloud. List the VM images that are available

-- Ensure that you have already logged into Azure Portal 
-- (with az login)

az vm image list        

You will see a JSON response as shown below

{
    "architecture": "x64",
    "offer": "CentOS",
    "publisher": "OpenLogic",
    "sku": "8_5-gen2",
    "urn": "OpenLogic:CentOS:8_5-gen2:latest",
    "urnAlias": "CentOS85Gen2",
    "version": "latest"
  },
  {
    "architecture": "x64",
    "offer": "debian-11",
    "publisher": "Debian",
    "sku": "11-backports-gen2",
    "urn": "Debian:debian-11:11-backports-gen2:latest",
    "urnAlias": "Debian11",
    "version": "latest"
  }, 
  {
   -- list of other VM images not shown here
   }        

If we want to create a Windows VM Image, Check the AZ VM cli options

az vm create -n MyVm -g MyResourceGroup --public-ip-address "" --image Win2012R2Datacenter        

for a Linux or Ubuntu VM

az vm create -n MyVm -g MyResourceGroup --image Ubuntu2204        

For example, if we want to create a Windows Image, replace <vm-name>, <resource-group-name> and <public-ip-address>

-- please check previous step on how to generate public ip address

az vm create -n <vm-name> -g <resource-group-name> --public-ip-address <public-ip-address> --image Win2022Datacenter        

Another example is here.

-- since we already created a resource group by name ind-adb-rg-oracle

az vm create -n ind-win-vm -g ind-adb-rg-oracle --public-ip-address 135.x.y.z --image Win2022Datacenter        

This will create a Windows VM Image which can be viewed on Azure Portal.

Windows VM created

10. Accessing Windows VM through RDP

Click on the connect button on top left and download the RDP file


Download RDP File

You can use any Remote Desktop RDP client or use Microsoft Windows App to open this RDP file. From here you can open a web browser and access any website, it will prompt for windows network configuration to allow external traffic, which you can accept.


Web page viewed through RDP into Azure Windows VM

11. Create Microsoft Azure Delegated Subnet

Subnet delegation is Microsoft's ability to inject a managed service, specifically a platform-as-a-service (PaaS) service, directly into your virtual network. This allows you to designate or delegate a subnet to be a home for an external managed service inside of your virtual network, such that external service acts as a virtual network resource, even though it is an external PaaS service. read more

replace <resource-group>, <subnet-name> and <network-name>

az network vnet subnet update \
    --resource-group <resource-group> \
    --name <subnet-name> \
    --vnet-name <network-name> \
    --delegations Oracle.Database/networkAttachments        

for example

az network vnet subnet update \
    --resource-group ind-adb-rg-oracle \
    --name ind-retail-subnet \
    --vnet-name ind-retail-adb-vnet-1 \
    --delegations Oracle.Database/networkAttachments        

Reality check

subnets created

Click on Details and check for Subnet Delegation into Oracle.Database/networkAttachments

Oracle Database / network attachments
Important: At any stage you can change network, subnet settings either using Azure Portal or using AZ CLI update parameters.

12. Create Oracle Autonomous Database @ Azure (Azure CLI)

Please check the official link to refer Azure CLI command for creating ADB and various parameters available.

az oracle-database autonomous-database create 
--location <location> 
--autonomousdatabasename <name> 
--resource-group <resource_group> 
--subnet-id /<subnet_id> 
--display-name <display_name> 
--compute-model ECPU 
--compute-count <compute_count> 
--data-storage-size-in-gbs <storage_size> 
--license-model <BringYourOwnLicense/LicenseIncluded> 
--db-workload <OLTP> 
--admin-password <password> 
--db-version 19c 
--character-set AL32UTF8 
--ncharacter-set AL16UTF16 
--vnet-id <virtual network id> 
--regular        

Another format of this create a shell script deploy-adb.sh

source ./config

az oracle-database autonomous-database create \
--location $LOCATION \
--autonomousdatabasename $ADB_NAME \
--resource-group $RESOURCE_GROUP \
--subnet-id $SUBNET_ID \
--display-name $ADB_NAME \
--compute-model ECPU \
--compute-count 2 \
--cpu-auto-scaling true \
--data-storage-size-in-gbs 500 \
--license-model BringYourOwnLicense \
--db-workload OLTP \
--db-version 23ai \
--character-set AL32UTF8 \
--ncharacter-set AL16UTF16 \
--vnet-id $VNET_ID \
--regular \
--admin-password Welcome1234# \        

Where the source file config will look as shown below

# update the values below to match your requirements

LOCATION="eastus"
RESOURCE_GROUP="resource-group-name-goes-here"
VNET_ID="vnet-resource-name-goes-here"  
SUBNET_ID="subnet-resource-name-goes-here" 
ADB_NAME="adb-name-goes-here"        

Keep the source file and deploy-adb.sh in same directory and run the sh file

chmod 777 deploy-adb.sh
./deploy-adb.sh        

Check Oracle Autonomous Database on Azure Portal

Oracle Autonomous Database @ Azure Cloud

Please check our GitHub for more details this.


13 Access Oracle Autonomous Database @ Azure

I would recommend watching this video from Alex Keh

The other option is to use Oracle Autonomous Database Studio or Oracle APEX. I shared the details in my previous article on Data Studio.

Also, if you want to create an Oracle Autonomous Database on the Google Cloud Platform, please check this article.


Thanks for reading, liking and sharing the article

Regards Madhusudhan Rao


References

Provisioning an Oracle Autonomous Database Serverless

Read more on Provisioning Oracle Autonomous Database on Azure Cloud

Oracle Database Service for Azure


Abderrahmane Abed

Analyste fonctionnel Oracle chez Curateur public du Québec

2 周

Thanks

回复
Gilson Melo

Director of Multicloud Services at Oracle | MBA | Ex-Apple, SuSE, AT&T | Driving Multicloud Innovation and Strategic Partnerships in Cloud Technology!

4 周

Very helpful, Madhusudhan Rao! Your guide on creating an Oracle Autonomous Database 23c on Microsoft #Azure #Cloud is a fantastic resource. It’s great to see both the Azure #Portal and #CLI approaches outlined, along with a comprehensive troubleshooting section. Looking forward to more content like this—keep it up!

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了