Share via

Batch account pool deletion stuck in resizing

Rahul Navin 0 Reputation points
2026-03-09T15:05:35.55+00:00

have one batch account with multiple batch pool. trying to delete one of the batch pool but it get stuck in resizing from almost 3 days now. looking for a solution to delete that pool completely

thanks

Azure Batch
Azure Batch

An Azure service that provides cloud-scale job scheduling and compute management.


2 answers

Sort by: Most helpful
  1. Ankit Yadav 12,825 Reputation points Microsoft External Staff Moderator
    2026-03-09T16:06:08.9666667+00:00

    Hey Rahul,

    it looks like your pool deletion is stuck in “Resizing” because the Batch service can’t finish tearing down all of the underlying resources. This usually happens when there are resource locks or leftover networking dependencies that block the deletion. Here’s what you can try:

    1. Check Activity Logs
      • Go to your Batch account in the Azure portal → Activity log.
      • Look for errors like “ScopeLocked” or messages about load balancers or NSGs being locked or in use.
    2. Remove Resource Locks
      • If you see a “ScopeLocked” error on the resource group or the Batch account itself, remove that lock: • Portal: Resource group → Locks → Delete the lock • Or use Azure CLI/PowerShell to remove the lock.
      • If you had a lock on extra networking resources (for example, the Azure-created load balancer), remove it from the virtual network’s resource group.
    3. Disassociate Batch-Created Networking Dependencies
      • If your pool was in a virtual network, Azure automatically created a load balancer, public IP, and NSG.
      • If the NSG is still attached to a subnet or another resource, go disassociate it: Virtual network → Subnets → Network security group → None.
      • Once disassociated, the Batch service should be able to delete the NSG and finish removing the pool within ~20 minutes.
    4. Wait and Verify
      • After unlocking and disassociating, wait about 20–30 minutes and refresh the portal.
      • The pool should move from “Deleting” → “Deleted.”

    If none of the above solves it, here are a few follow-up questions so we can drill down further:

    • What exact error message do you see in the Activity log when the delete hangs?

    • Do you have any locks on the resource group or the Batch account?

    • Is the pool connected to a virtual network?

    • Have you checked for locks on the load balancer or NSG in that VNet’s resource group?

    • Did you try removing/disassociating the NSG from any subnets?

    Hope this helps you get that pool fully deleted!

    Reference list

    Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.

    0 comments No comments

  2. Q&A Assist
    2026-03-09T15:05:51.2966667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Use the following steps to unblock and complete deletion of the stuck Batch pool.

    1. Confirm the pool is in deleting/resizing state
      • Use Azure Portal or CLI to verify the pool state and that it has been stuck for a long time. Batch sets poolState to deleting and resizes nodes to zero before removing the pool object.
      • If deletion is taking longer than expected, Batch keeps retrying, but certain issues require manual fixes.
    2. Check for resource locks on the Batch account and its resource group
      • In the Azure portal, go to the resource group that contains the Batch account.
        • Check Locks on the resource group.
          • If there is a lock (for example, Delete or ReadOnly), remove it.
          • This resolves Cause 1a where the Batch account’s resource group is locked and prevents delete operations.
      • Then open the Batch account resource.
        • Check Locks on the Batch account itself.
          • If present, remove the lock.
          • This resolves Cause 1b where the Batch account is locked.
      • After removing locks, wait ~20 minutes and re-check the pool; if still present, retry deletion.
    3. If the pool uses a virtual network, check locks and dependencies on Batch-created network resources
      • When a pool is created in a virtual network, Batch automatically creates:
        • Network Security Group (NSG)
        • Public IP address
        • Load balancer
      • Deleting or resizing the pool to zero requires Batch to delete these resources.
      a) Check for resource locks on the VNet resource group
      • Go to the resource group that contains the virtual network used by the pool.
      • Check Locks on that resource group.
        • If there is a lock, remove it.
        • This resolves Cause 2a where extra networking resources in the resource group are locked and block deletion of the Batch-created load balancer.
      • After removing locks, wait ~20 minutes for Batch to complete deletion.
      b) Check for external dependencies on Batch-created resources
      • In the same resource group, locate the Batch-created NSG, public IP, and load balancer (names typically include azurebatch-cloudserviceloadbalancer or azurebatch-cloudservicenetworksecuritygroup).
      • If the NSG is associated with other subnets or NICs outside the Batch pool, or if other resources depend on the Batch-created IP or load balancer, Batch cannot delete them and the pool deletion will hang.
        • For example, an activity log entry like:
          • Network security group ... cannot be deleted because it is in use by ... virtualNetworks/<vnet>/subnets/<subnet>
          • indicates Cause 2b.
      • Fix by disassociating these dependencies:
      • After removing dependencies, wait ~20 minutes; Batch should finish deleting the pool and its network resources.
    4. Retry or monitor deletion via CLI/SDK
      • If needed, explicitly request deletion again:
        • Azure CLI:
                 az batch pool delete --pool-id <pool-id>
          
        • Or via Python SDK PoolOperations.delete(pool_id=...).
      • Note: If the pool is already in deleting state, any further Update/Patch/Delete calls will fail with HTTP 409 PoolBeingDeleted until the underlying issues (locks/dependencies) are resolved.
    5. If deletion still does not complete
      • After removing all locks and external dependencies and waiting sufficient time, if the pool remains stuck, check for broader conditions mentioned for pool deletion failures:
        • Ensure Microsoft.Batch resource provider is still registered in the subscription.
        • For user subscription mode accounts, ensure Microsoft Azure Batch still has Contributor or Owner role on the subscription that contains the pool.

    Once all locks and external dependencies are cleared and Batch has required permissions, the stuck pool should automatically complete deletion within about 20 minutes; if not, re-issuing the delete request after fixes should succeed.


    References:

    0 comments No comments

Your answer

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