Delete an Azure Red Hat OpenShift 4 cluster

This article shows you how to delete an Azure Red Hat OpenShift cluster.

Before you begin

This article requires Azure CLI version 2.6.0 or later. Run az --version to find the version. If you need to install or upgrade, see Install Azure CLI.

Sign in to Azure

If you're running the Azure CLI locally, run az login to sign in to Azure.

az login

If you have access to multiple subscriptions, run az account set -s {subscription ID} replacing {subscription ID} with the subscription you want to use.

Delete the cluster

In previous articles for creating and connecting a cluster, the following variable was set:

RESOURCEGROUP=yourresourcegroup
CLUSTER=clustername

Using these values, delete your cluster:

az aro delete --resource-group $RESOURCEGROUP --name $CLUSTER

You'll then be prompted to confirm if you are sure you want to perform this operation. After you confirm with y, it will take several minutes to delete the cluster. When the command finishes, the cluster will be deleted and all the managed objects.

Note

User-created objects such as virtual network and subnets must be manually deleted accordingly.

Next steps

Learn more about using OpenShift with the official Red Hat OpenShift documentation.