I deleted my resource group and all resources inside the resource group but after few seconds it automatically recreated the group and all the resources. I tried many times but no help

Pankaj Strivers 0 Reputation points
2026-11-26T05:36:55.0466667+00:00

I deleted my resource group and all resources inside the resource group but after few seconds it automatically recreated the group and all the resources. I tried many times but no help

Azure
Azure

A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.

0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-26T05:38:02.5733333+00:00

    Do not delete the resource group again until the Azure Activity Log identifies the identity and operation recreating it; then disable that controlling policy, automation, deployment, or managed application before performing the final deletion.

    1. Identify what recreated the group

    Because the resource group was deleted and recreated, inspect the log at the subscription scope:

    1. Open Azure portal → Subscriptions → your subscription → Activity log.
    2. Set the time range to include the latest recreation.
    3. Add filters:
      • Operation: create/write operations.
      • Resource group: the recreated group, if available.
      • Status: Succeeded.
    4. Open the earliest successful write event for the recreated resource group or one of its resources.
    5. Record:
      • Event initiated by / Caller
      • Operation name
      • Correlation ID
      • Resource ID
    6. Filter by that Correlation ID to see all resources created by the same deployment.

    The Activity Log is the authoritative location for determining who created a resource. Entries can take approximately 3–20 minutes to appear and are retained for 90 days by default.^1^

    You can also inspect recent events from Azure Cloud Shell:

    rg="<resource-group-name>"
    
    az monitor activity-log list \
      --resource-group "$rg" \
      --offset 1d \
      --query "[?status.value=='Succeeded'].{
        time:eventTimestamp,
        caller:caller,
        operation:operationName.value,
        correlationId:correlationId
      }" \
      --output table
    

    If the resource-group filter returns nothing because the group was absent between deletion and recreation, run the same command without --resource-group and inspect subscription-level events.

    2. Stop the creator shown in the log

    If the caller is an Azure Policy managed identity

    Check Azure portal → Policy → Assignments at all applicable scopes:

    • Resource group
    • Subscription
    • Management group

    Open matching assignments and inspect definitions using the deployIfNotExists or modify effect, plus any associated remediation task. A deployIfNotExists policy can execute a template deployment when required related resources are missing; policy remediation uses the managed identity associated with the assignment.^2^^3^

    If the assignment is no longer required:

    1. Obtain approval from the subscription or management-group owner.
    2. Delete or change the assignment, or create an appropriate policy exemption.
    3. Stop/cancel any applicable remediation task.
    4. Confirm no new write operations appear in the Activity Log.
    5. Delete the resource group once.

    Do not remove a management-group policy merely to delete one workload unless its owner confirms that this is intended.

    If the caller is a service principal, managed identity, or user

    The resources are likely being redeployed by an external controller. Use the caller identity and correlation ID to locate:

    • Azure DevOps or GitHub deployment pipelines
    • Terraform/Bicep/ARM scheduled deployments
    • Azure Automation runbooks and linked schedules
    • Logic Apps or Functions
    • Third-party/Marketplace management products

    Pause or disable the job first. Then check Subscription → Access control (IAM) → Role assignments for that identity and remove its write access only if it should no longer manage the environment. Review the owning team before changing shared service-principal permissions.

    If the operation refers to Microsoft.Solutions

    Check Azure portal → Managed Applications for an application that owns the resource group. Delete the managed application instance, rather than repeatedly deleting its managed resource group. Microsoft documents that deleting a managed application also deletes its managed resource group.^4^

    3. Distinguish recreation from stale portal state

    A successful write event with a new creation timestamp confirms genuine recreation. If there is no corresponding create/write event and CLI reports that the group does not exist, the portal may be showing cached or delayed metadata rather than active resources.

    After the controlling mechanism is stopped, delete the group through Resource groups → select group → Delete resource group, or:

    az group delete \
      --name "<resource-group-name>" \
      --yes
    

    Deleting a resource group removes the resources it contains, and the group itself cannot generally be recovered as a unit.^5^


    References

    1. Activity log in Azure Monitor
    2. Azure Policy definitions deployIfNotExists effect
    3. Remediate non-compliant resources with Azure Policy
    4. Azure Managed Applications overview
    5. Azure Resource Manager resource group and resource 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.