Azure Backup: Unable to delete Recovery Services vault due to existing Azure Site Recovery dependencies

Koudelia Nikolai (Futurice) 0 Reputation points
2026-10-16T14:25:07.4766667+00:00

Problem description

I am trying to delete a Recovery Services vault in Azure Backup, but the operation fails with the error code 'BMSUserErrorVaultDeletionNotAllowed'. The error indicates that the vault still contains an existing resource, specifically a SQL-related item associated with the vault. Despite reviewing the vault in the Azure portal, I see no backup items or backup infrastructure entries, and the counts are zero. I also attempted to delete the vault using Azure CLI, but it still reports dependencies related to a SQL workload, particularly 'Sql;htfakturahotelldev-rg;htfhsqltest01'. I have already verified that there are no visible backup items, infrastructure entries, or soft-deleted items, and there are no private endpoints or resource locks on the vault.

Environment

Azure Backup with a Recovery Services vault in an unspecified region. The delete attempt was performed using Azure CLI with the command 'az backup vault delete --name {vault-name} --resource-group {resource-group} --yes'. The vault appears empty in the portal, but the error points to a SQL workload dependency.

What I've already tried

I reviewed the vault in the Azure portal and confirmed that there are no visible backup items or infrastructure entries, with counts showing zero. I also attempted to delete the vault through Azure CLI, which failed with the 'BMSUserErrorVaultDeletionNotAllowed' error, referencing a SQL-related resource. I verified that there are no soft-deleted items, private endpoints, or resource locks on the vault. Additionally, I ran commands to list Azure workload containers and backup items, which returned empty lists, indicating no visible backup objects. I suspect there might be a hidden or stale SQL workload registration still attached to the vault, which is preventing deletion.

Current status

I am seeking guidance on how to identify and remove any hidden or stale SQL workload dependencies attached to the vault so that I can successfully delete the Recovery Services vault.

Azure Backup
Azure Backup

An Azure backup service that provides built-in management at scale.


1 answer

Sort by: Newest
  1. Allan Solomon Mejia 10,545 Reputation points
    2026-10-17T16:33:31.52+00:00

    Hello @Koudelia Nikolai (Futurice)

    Thanks for providing the detailed troubleshooting results.

    Since you've already verified that the Recovery Services vault contains no visible backup items, registered infrastructure, soft-deleted items, private endpoints, or resource locks, I agree that repeating the standard vault cleanup steps is unlikely to help.

    The important clue is the error: BMSUserErrorVaultDeletionNotAllowed

    The deletion request still references: Sql;htfakturahotelldev-rg;htfhsqltest01

    This suggests that Azure Backup still detects a SQL workload dependency, even though the corresponding resources aren't visible in the portal or your CLI queries.

    Recommended next step

    As the Microsoft moderator suggested, unregistering the SQL workload container is worth checking. However, since your earlier container-list commands returned empty results, first verify whether Azure PowerShell can discover the container.

    Microsoft documents the following approach for retrieving SQL workload containers:

    $vault = Get-AzRecoveryServicesVault `
        -ResourceGroupName "<resource-group>" `
        -Name "<vault-name>"
    $containers = Get-AzRecoveryServicesBackupContainer `
        -ContainerType AzureVMAppContainer `
        -BackupManagementType AzureWorkload `
        -VaultId $vault.ID
    $containers | Format-List Name, FriendlyName, ContainerType
    

    If the affected SQL container appears, confirm that all associated protected data has already been removed before unregistering it.

    The following cmdlet for unregister an existing container:

    Unregister-AzRecoveryServicesBackupContainer `
        -Container $container `
        -VaultId $vault.ID
    

    Here, $container must be the specific container object selected and verified from the preceding query.

    Important: Unregistering a backup container changes its registration with the Recovery Services vault. Before proceeding, confirm that no protected SQL databases or recovery points need to be retained.

    If the container is not returned

    If Azure PowerShell also returns no matching SQL workload container, but vault deletion continues reporting the same dependency, stop attempting additional deletion or cleanup commands.

    At that point, the available evidence suggests a possible inconsistency between the vault's visible resources and the dependencies detected during deletion.

    However, we cannot conclusively identify an orphaned backend registration without Microsoft investigating the service-side metadata.

    Microsoft Support investigation

    I recommend opening an Azure Backup support request and providing:

    • Recovery Services vault name and resource ID.
    • Error code: BMSUserErrorVaultDeletionNotAllowed.
    • Referenced SQL workload: Sql;htfakturahotelldev-rg;htfhsqltest01.
    • Results of the Azure CLI and PowerShell container queries.
    • Failed deletion timestamp and correlation ID from the Azure Activity Log.

    Ask Microsoft Support to verify whether a stale SQL workload registration or another internal dependency is preventing vault deletion.

    I don't recommend bypassing the dependency checks through direct resource deletion requests or running automated vault cleanup scripts, particularly while the SQL registration state remains uncertain.

    Could you confirm whether the Azure PowerShell query also returns no results, or whether it identifies the SQL workload container?

    That distinction should help determine whether we can still use a documented unregistration procedure or whether Microsoft needs to investigate the remaining dependency.

    Hope this helps narrow down the issue.

    References:


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?

    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.