Cannot delete Service bus in Azure as it contains an issue

David Cuervo 0 Reputation points
2025-08-28T21:46:44.0933333+00:00

Migration config cannot be deleted because replication is in progress. Please complete or abort migration before attempting to delete the config.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Suwarna S Kale 3,956 Reputation points
    2025-08-29T02:12:23.7633333+00:00

    Hello David Cuervo,

    Thank you for posting your question in the Microsoft Q&A forum.  

    The error indicates you cannot delete the Azure Service Bus namespace because an active migration replication process is still underway, which places a protective lock on the resource to prevent data loss or corruption during transfer.

    To resolve this, you must first navigate to the migration configuration within your Service Bus namespace in the Azure portal and explicitly abort the ongoing migration operation. Once the migration has been successfully terminated, the replication lock will be removed, allowing you to proceed with deleting the migration configuration itself. Only after these intermediary steps are completed will the namespace be released from its operational state, enabling you to perform the final deletion.

    This process ensures data integrity is maintained by preventing accidental deletion during critical operations. If the abort action fails or the issue persists, contacting Azure support may be necessary to investigate potential backend state inconsistencies.

    Please, let me know the response helps answer your question? If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. 🙂 

    0 comments No comments

  2. Anurag Rohikar 600 Reputation points Microsoft External Staff Moderator
    2025-08-29T09:43:43.9666667+00:00

    Thanks for reaching out on Microsoft Q&A and really appreciate your patience while we looked into this.

    Also, a big thanks to Suwarna S Kale for already sharing the correct direction. The issue is indeed due to an active Service Bus migration replication process, which places a protective lock on the namespace and prevents its deletion. To resolve this, you must first abort or complete the migration. Once the migration is terminated, the lock will be removed, allowing you to proceed with deleting the namespace.

    Solution Steps:

    OPTION 1: Using the Azure Portal

    1. Navigate to your Service Bus namespace in the Azure portal.
    2. In the left-hand menu, under Settings, select Migrate.
    3. On the migration page, you will see the status of the replication. If it is active, you will have an option to Abort Migration. Click this to terminate the process.
    4. Once the migration is aborted, you can proceed to delete the namespace.

    OPTION 2: You can do this either in the Azure portal or with the Azure CLI:

    # Check migration status
    az servicebus migration show -g <resource-group> -n <namespace>
    # Abort migration
    az servicebus migration abort -g <resource-group> -n <namespace>
    # Or complete migration if you intend to finalize it
    az servicebus migration complete -g <resource-group> -n <namespace>
    # Delete migration config (if needed)
    az servicebus migration delete -g <resource-group> -n <namespace>
    # Finally, delete the namespace
    az servicebus namespace delete -g <resource-group> -n <namespace>
    

    In some cases, if there’s a geo-DR pairing, you may also need to break it manually before deletion:

    az servicebus georecovery-alias break-pair -g <resource-group> --namespace-name <namespace> --alias <alias>
    

    References:

    Hope this helps! Please let us know if you still have any questions. Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.