Share via

Unable to delete Replicated Item from RSV

Lakhan Rohilla 45 Reputation points
2026-03-26T16:55:59.03+00:00

Hi Team,

I setup the replication for one vm using HyperV replication and faced some issues for insuffecient region quota. As the region gets locked out during first replication, i uninstalled ther Hyperv Provider on the hyperV host without stooping the replication and now i am unable to remove that failed replication. I have tried from RSV section as well as via Az Migrate and unable to delete it. Need expert advise on how to force delete the failed replicated job from portal completely.

User's image

Azure Migrate
Azure Migrate

A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.


Answer accepted by question author
  1. Suchitra Suregaunkar 11,395 Reputation points Microsoft External Staff Moderator
    2026-03-27T01:13:58.7333333+00:00

    Hello Lakhan Rohilla

    From your screenshot, the replicated item “Demovm” shows Replication Health = Healthy but Status = “Disabling protection”, and the active location is “MyDemoProject‑HyperVSite” (Failover health “–”). That pattern usually means the disable/cleanup operation is stuck and the portal can’t complete the final delete.

    You uninstalled the Hyper‑V Provider while replication/disable was still in progress, so the service that ASR/Azure Migrate uses to “cleanly” disable protection and remove the protected item can’t complete the workflow. When the source side is missing/not reachable, Use Remove (instead of “Disable replication and remove”) because it stops billing and removes the item from ASR without cleaning on‑prem configuration.

    If the item is already stuck in “Disabling protection”, you often need to force-remove the protected item record via CLI/PowerShell/REST (depending on whether it’s an ASR protected item or an Azure Migrate Data Replication protected item).

    Please have a look into below Workaround:

    A. If this is an Azure Site Recovery (ASR) replicated item (Microsoft.RecoveryServices…)

    Microsoft documents two different operations:

    • remove = clean disable replication (and remove the item)
    • delete = force delete / purge the replication protected item

    List protected items (to confirm fabric/container/item names):

    Open Azure CLI and try below commands:

    az site-recovery protected-item list \
      --resource-group <vaultRG> \
      --vault-name <vaultName> \
      --fabric-name <fabricName> \
      --protection-container-name <containerName>
    
    
    
    1. Try clean remove first:
    az site-recovery protected-item remove \
      --resource-group <vaultRG> \
      --vault-name <vaultName> \
      --fabric-name <fabricName> \
      --protection-container-name <containerName> \
      --replicated-protected-item-name <protectedItemName>
    
    
    1. If it’s still stuck → force delete/purge:
    az site-recovery protected-item delete \
      --resource-group <vaultRG> \
      --vault-name <vaultName> \
      --fabric-name <fabricName> \
      --protection-container-name <containerName> \
      --replicated-protected-item-name <protectedItemName>
    
    
    
    1. As an alternative try Remove-AzRecoveryServicesAsrReplicationProtectedItem to disable replication for an ASR replication protected item and supports -Force and -WaitForCompletion.

    “Remove-AzRecoveryServicesAsrReplicationProtectedItem … disables replication … and causes replication to stop for the protected item.”

    # After you obtain the ASR replication protected item object ($rpi):
    Remove-AzRecoveryServicesAsrReplicationProtectedItem -InputObject $rpi -Force -WaitForCompletion
    
    

    Reference: https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/remove-azrecoveryservicesasrreplicationprotecteditem?view=azps-15.4.0

    If you prefer ARM calls, use below REST API:

    ASR “disable replication/remove” is also exposed as a REST operation: POST .../replicationProtectedItems/{name}/remove?api-version=2025-08-01

    Reference: https://learn.microsoft.com/en-us/rest/api/site-recovery/replication-protected-items/delete?view=rest-site-recovery-2025-08-01&tabs=HTTP

    B. If your replication item is under Microsoft.DataReplication/replicationVaults/protectedItems, Microsoft’s REST API supports force delete via forceDelete=true.

    You need to use PowerShell (Invoke-AzRestMethod) to delete stuck protected item:

    Connect-AzAccount
    Set-AzContext -Subscription "<subscriptionId>"
    
    $sub = "<subscriptionId>"
    $rg  = "<resourceGroupName>"
    $rv  = "<replicationVaultName>"
    $api = "2024-09-01"
    
    # 1) List protected items
    $items = Invoke-AzRestMethod -Method GET -Path "/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.DataReplication/replicationVaults/$rv/protectedItems?api-version=$api"
    $items.Content
    
    # 2) Delete the specific protected item (use the protectedItemName you find above)
    $pi = "<protectedItemName>"   # often looks like a GUID/name shown in the JSON
    Invoke-AzRestMethod -Method DELETE -Path "/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.DataReplication/replicationVaults/$rv/protectedItems/$pi?api-version=$api"
    
    # 3) If normal delete fails, force delete
    Invoke-AzRestMethod -Method DELETE -Path "/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.DataReplication/replicationVaults/$rv/protectedItems/$pi?api-version=$api&forceDelete=True"
    
    

    After this, refresh Azure Migrate/RSV views; the protected item record should disappear once the delete operation completes.

    Important Note:

    1. If you choose “Remove” (portal/CLI remove) when the source is unavailable, Microsoft notes that on‑prem replication configuration will not be cleaned up (because the source environment isn’t reachable).
    2. A force delete/purge is effectively “backend cleanup” of the Azure record—use it only when the clean remove path is stuck and you’re sure you don’t need that replication metadata anymore.

    When you click the stuck replicated item and look at its Resource ID, does it contain Microsoft.DataReplication or Microsoft.RecoveryServices?

    • Microsoft.DataReplication → use Option B (Invoke-AzRestMethod forceDelete)
    • Microsoft.RecoveryServices → use Option A (az site-recovery protected-item delete/remove or Remove-AzRecoveryServicesAsrReplicationProtectedItem)

    Kindly let us know if the solution provided worked for you.

    If you need any further assistance, please feel free to reach out.

    If you found the comment helpful, please consider clicking "Upvote it".

    Thanks,

    Suchitra.

    1 person found this answer helpful.

0 additional answers

Sort by: Most 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.