I am unable to delete resource grp in which i use foundry project but after deleting all the deployments and agents still deletion of resource group shown error

Aman Arya 0 Reputation points
2026-10-15T17:17:29.3+00:00

I am unable to delete resource grp in which i use foundry project but after deleting all the deployments and agents still deletion of resource group shown error

Azure OpenAI in Foundry Models
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-10-15T17:17:48.58+00:00

    If the resource group still fails to delete after removing deployments and agents, the remaining blockers are usually one of these:

    1. Check the resource group Activity log first. This is the most direct way to find the exact resource or operation blocking deletion.
      • In Azure portal, open the resource group.
      • Select Activity log.
      • Look for failed delete operations.
    2. Verify that the Foundry project itself is deleted, not only its deployments and agents.
      • Deleting a resource group removes everything in it, but Foundry-related resources can still block deletion if the project or connected resources still exist.
      • If the project was created in a shared resource group, delete the project first rather than deleting the whole resource group.
    3. Check for other remaining Foundry-related resources in the resource group. Common blockers mentioned in the documentation include:
      • deployed models
      • connected tool resources
      • the Foundry resource itself
    4. If the goal is to delete only the Foundry resource, do it from the resource group view:
      • In Azure portal, go to Resource Groups.
      • Open the resource group.
      • Find the Foundry resource.
      • Select the ellipsis for that row, then select Delete.
    5. If the goal is to delete the entire resource group:
      • In Azure portal, go to Resource Groups.
      • Open the target resource group.
      • Select Delete resource group.
      • If this still fails, the Activity log should identify the blocking resource.
    6. Check for non-Foundry blockers in the resource group. Resource group deletion can also fail because of:
      • resource dependencies
      • resource locks
      • subscription issues
      • resources that must be deleted in a specific order
    7. If the Foundry/OpenAI resource still exists, delete it directly with PowerShell or Azure CLI. Examples from the documentation: PowerShell:
         Remove-AzCognitiveServicesAccount -Name MyOpenAIResource -ResourceGroupName OAIResourceGroup
      
      Azure CLI:
         az cognitiveservices account delete \
         --name <myResourceName> \
         --resource-group <myResourceGroupName>
      
    8. If a deployed model still exists, delete it explicitly with Azure CLI:
         az cognitiveservices account deployment delete \
         --name <myResourceName> \
         --resource-group <myResourceGroupName> \
         --deployment-name MyModel
      

    Important warning: deleting a resource group permanently deletes every resource in it. Review the resource list before confirming deletion.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was 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.