Hallo @Andy Tost
Vielen Dank, dass Sie uns wegen des Azure Local-Problems kontaktiert haben.
#=============================================================================
Purpose : Deletes Azure Stack HCI resources (VM, Disk, NIC) via the
Azure Resource Manager REST API using the Azure CLI.
WARNING : This script forcefully deletes resources and does not ensure
metadata cleanup. It should only be used when the Azure Local
instance is unrecoverable and will not be reused.
Prerequisites:
- This script must be run from an administrator PowerShell prompt.
- Azure CLI must be installed.
- Run 'az login' to authenticate before invoking this script.
- Fill in the placeholder values for subscription, resource group,
VM name, disk name, and NIC name before execution.
Notes:
- After each DELETE call the script performs a GET to confirm the
resource has been removed.
Configuration fill the values before running the script.
Azure Sub ID
$subscriptionId = "Add subscription ID here"
RG containing the target resources
$resourceGroup = "Add resource group name here"
Base Azure Resource Manager URI scoped to the subscription and resource group
$baseUri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/"
API version for Azure Stack HCI resource operations
$apiVersion = "2025-06-01-preview"
API version for Hybrid Compute (Arc) machine operations
$hcApiVersion = "2024-11-10-preview"
Name of the Arc-enabled (Hybrid Compute) virtual machine
$vmName = "Add VM name here"
URI targeting the Hybrid Compute (Arc) machine resource
$hciVmUri = $baseUri + "providers/Microsoft.HybridCompute/machines/" + $vmName + "?api-version=$($hcApiVersion)"
URI targeting the Azure Stack HCI virtual machine instance linked to the Arc machine
$vmUri = $baseUri + "providers/Microsoft.HybridCompute/machines/" + $vmName + "/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default?api-version=" + $apiVersion + "&force=true"
Name of the virtual hard disk to delete
$diskName = "Add disk name here"
URI targeting the Azure Stack HCI virtual hard disk resource
$diskUri = $baseUri + "providers/Microsoft.AzureStackHCI/virtualHardDisks/$($diskName)?api-version=$($apiVersion)&force=true"
Name of the network interface to delete
$nicName = "Add NIC name here"
URI targeting the Azure Stack HCI network interface resource
$nicUri = $baseUri + "providers/Microsoft.AzureStackHCI/networkInterfaces/$($nicName)?api-version=$($apiVersion)&force=true"
---------------------------------------------------------------------------
Set the active Azure subscription
az account set -s $subscriptionId
Delete the Azure Stack HCI virtual machine instance
az rest --method delete --uri $vmUri
Verify the HCI VM instance has been removed (should return 404)
az rest --method get --uri $vmUri
Delete the underlying Hybrid Compute (Arc) machine resource
az rest --method delete --uri $hciVmUri
Verify the Arc machine resource has been removed (should return 404)
az rest --method get --uri $hciVmUri
Delete the Azure Stack HCI Virtual Hard Disk
az rest --method delete --uri $diskUri
Verify the disk has been removed
az rest --method get --uri $diskUri
---------------------------------------------------------------------------
Delete the Azure stack HCI network
az rest --method delete --uri $nicUri
Verify the NIC has been removed
az rest --method get --uri $nicUri Dieses Skript half dabei, die Instanzen zu löschen.
Thanks,
Manish.