Quickstart: Delete an Azure Red Hat OpenShift with hosted control planes cluster (preview)

In this quickstart, you delete an Azure Red Hat OpenShift with hosted control planes (HCP) cluster by using the Azure CLI. When you delete the cluster, you also delete its node pools and the managed resource group. The customer resource group, virtual network, and subnets aren't deleted automatically. You must remove these resources separately.

Prerequisites

  • Azure CLI version 2.67.0 or higher. Use az --version to check your installed version. To install or upgrade, see Install Azure CLI.

Delete the cluster

  1. Set the following environment variables. Replace the placeholder values with the names of the resource group and cluster that you want to delete.

    CUSTOMER_RG_NAME="<resource-group-name>"
    CLUSTER_NAME="<cluster-name>"
    
  2. Delete the cluster. This operation is asynchronous and might take several minutes to complete.

    az aro hcp cluster delete \
      --name "${CLUSTER_NAME}" \
      --resource-group "${CUSTOMER_RG_NAME}" \
      --yes
    
  3. Verify that the cluster is deleted by checking its status. If the cluster is successfully deleted, this command returns a resource not found error.

    az aro hcp cluster show \
      --name "${CLUSTER_NAME}" \
      --resource-group "${CUSTOMER_RG_NAME}" \
      --query "properties.provisioningState" \
      --output tsv
    

Clean up resources

After the cluster is deleted, delete the resource group if you no longer need it. Deleting the resource group also deletes the virtual network, subnets, and any other resources it contains.

az group delete --name ${CUSTOMER_RG_NAME}