Share via


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. To find the version, run the az --version command. 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're prompted to confirm if you're 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 is 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.