Batch account stuck in deleting state

Erik Heeren 20 Reputation points
2025-08-18T14:20:00.9166667+00:00

Hi,

We've got a batch account that's been stuck in deleting state for a while now.

Retrying the delete through the cli informs me that the pool is already in a deleting state, and through the portal shows an "error deleting Batch account" (after showing that there are n/a number of pools, active jobs, active job schedules and certificates

The locks page for both the batch account and the resource group shows that "This resource has no locks."

What can I do to fully get rid of this account?

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
{count} votes

2 answers

Sort by: Most helpful
  1. Durga Reshma Malthi 11,400 Reputation points Microsoft External Staff Moderator
    2025-08-19T15:53:58.5366667+00:00

    Hi Erik Heeren

    If you can access the Batch account, try to forcefully delete any pools or jobs associated with it:

    az batch pool delete --account-name <YourBatchAccountName> --pool-id <YourPoolId> --yes
    az batch job delete --account-name <YourBatchAccountName> --job-id <YourJobId> --yes
    

    If the CLI and PowerShell commands are not working, you can try using the Azure Resource Manager REST API to forcefully delete the Batch account.

    DELETE https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Batch/batchAccounts/<batchAccount>?api-version=2023-05-01
    

    Also try this as well: Go to Azure Portal -> subscriptions -> your-subscription -> resource Groups -> your-resource-group -> providers -> Microsoft.Batch -> batchAccounts -> your-account. Check the properties section for any lingering metadata or child resources. If the DELETE button is available, try using it here, it sometimes bypasses portal/CLI restrictions.

    Hope this helps!

    Please Let me know if you have any queries.

    2 people found this answer helpful.

  2. Durga Reshma Malthi 11,400 Reputation points Microsoft External Staff Moderator
    2025-08-20T16:08:02.5166667+00:00

    Hi Erik Heeren

    Then it might be a backend issue within Batch service.

    The providers/Microsoft.Batch/batchAccounts/<account-name> path is part of Azure’s resource ID structure used internally and in REST API calls. You won’t see a provider's folder in the portal; it’s more of a logical path used by Azure Resource Manager to identify and manage resources.

    Based on your case, the Batch account deletion was initiated, but internal cleanup of dependent services failing silently.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.