Unable to delete a resource

UJ 40 Reputation points
2025-11-24T17:00:16.2366667+00:00

I have been using Azure for my certification exam. I have noticed that my billing has jumped very high due to a resource that was recently added. When I tried to delete that resource, it throws following error:

Delete resource group rg-xxx-0742 failed

Failed to delete resource group rg-xxx-0742: Deletion of resource group 'rg-xxx-0742' failed as resources with identifiers 'Microsoft.CognitiveServices/accounts/xxx-0742-resource' could not be deleted. The provisioning state of the resource group will be rolled back. The tracking Id is 'f6c030f3-a2b7-475a-a848-24ed9edxxxx'. Please check audit logs for more details. (Code: ResourceGroupDeletionBlocked) Could not delete account since it contains 1 deployment(s). Please delete deployments first and try again. (Code: CannotDeleteAccountWithDeployments, Target: /subscriptions/61fe1a34-1530-41a0-b8e3-d94b59xxx/resourceGroups/rg-xxx-0742/providers/Microsoft.CognitiveServices/accounts/xxx-0742-resource)

Please assist. It keeps adding cost until its removed.

Thanks

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

Answer accepted by question author
Adam Zachary 2,265 Reputation points
2025-11-24T19:19:43.3866667+00:00

I’ve seen this before with Azure AI and Foundry resources, and the error is accurate.

You can’t delete the Cognitive Services account because it still has at least one deployment attached to it. Azure blocks the entire resource group deletion until every model deployment under that account is removed.

To fix your issue, open the Cognitive Services resource itself and go to the “Models + endpoints” blade. Even if the screen looks empty, switch tabs and check “Service endpoints” or any model deployments listed there. Foundry deployments sometimes hide there and don’t show up in the regular RG view.

Delete every deployment under that account first. Once the deployments are gone, Azure will allow the Cognitive Services account to delete, and the resource group will remove cleanly.

Every time I’ve run into this, removing the hidden deployment is what unblocked the deletion.

Was this answer helpful?

2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Manas R Mohanty 17,270 Reputation points Moderator
    2025-11-24T18:24:47.7866667+00:00

    Hi UJ

    If you have model endpoint/deployments, please delete them first.

    Without deleting underlying deployments from Models+endpoints tab, It won't allow you to delete the Cognitive Service account.

    User's image

    Thank you.

    Was this answer helpful?

    3 people found this answer helpful.

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.