Delete AKS on bare metal cluster resources (preview)

Important

Azure Kubernetes Service on bare metal is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. Azure Kubernetes Service on bare metal previews are partially covered by customer support on a best-effort basis.

This article shows you how to delete AKS on bare metal cluster and edge machine resources from Azure. You must follow the deletion order described in this article. Deleting resources out of order results in orphaned resources or failed deletions.

Warning

Some steps require waiting for completion before proceeding. Don't skip ahead.

Deletion order

Step Resource Wait required Notes
1 AKS cluster Yes Must fully complete before continuing.
1b (optional) Data Collection Rule No Only if you created a data collection rule during cluster creation.
2 Logical Network (LNET) No
3 Device Pool Yes Automatically deletes the Custom Location. Must fully complete before continuing.

Step 1: Delete the AKS cluster

  1. In the Azure portal, go to resource groups and then select the resource group that you created for the cluster.
  2. Select the AKS cluster resource.
  3. Select Delete and confirm.
  4. Wait for the deletion to complete before proceeding.

CLI alternative:

az resource delete --ids <cluster-resource-id>

Step 2: Delete the Azure Local Logical Network (LNET)

  1. In the resource group, select the Azure Local Logical Network resource.
  2. Select Delete and confirm.

CLI alternative:

az resource delete --ids <lnet-resource-id>

If you created a data collection rule during cluster creation, delete it now.

  1. In the resource group, select the Data Collection Rule resource.
  2. Select Delete and confirm.

CLI alternative:

az resource delete --ids <data-collection-rule-resource-id>

Step 2: Delete the Logical Network (LNET)

  1. In the resource group, select the Logical Network resource.
  2. Select Delete and confirm.

CLI alternative:

az resource delete --ids <lnet-resource-id>

Step 3: Delete the Device Pool

  1. In the resource group, select the resource with a name ending in mset and type Azure Stack | Preview.
  2. Select Delete and confirm.
  3. Wait for the deletion to complete. This action automatically deletes the Custom Location.

CLI alternative:

az resource delete --ids <device-pool-resource-id>

Note

You don't need to manually delete the Custom Location. It's removed automatically when the Device Pool is deleted.

At this point, you deleted all your AKS on bare metal cluster resources. If you also want to delete the Azure Local Small Form Factor resources, follow the guidance at How do I delete all the resources from a test?.

Troubleshooting

Issue Cause Fix
Resource stuck in "Deleting" state Dependency not deleted first. Verify you followed the order above. Wait and retry.
Custom Location still exists after Device Pool delete Deletion still in progress. Wait a few more minutes. The deletion cascades automatically.

Next steps