Can I retrieve messages sent to a topic retroactively with a new subscription?

Antonio Dubravcic 0 Reputation points
2023-09-07T14:22:39.03+00:00

I had a topic for my service bus and I had 2 subscriptions. the subscriptions then disappeared or got deleted. I had not even processed any of the messages. so here are my 2 questions:
1.- Can I retrieve messages retroactively with a new subscription?
2.- How can I found out who or what deleted my previous subscriptions

Thanks in advance for any help

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
594 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 24,111 Reputation points
    2023-09-07T17:01:57.07+00:00

    Hi @Antonio Dubravcic Thanks for reaching out. Unfortunately, there is no way to retrieve messages retroactively with a new subscription. Once a subscription is deleted, all the messages in it are also deleted and cannot be recovered. The only way to prevent this from happening again is to make sure you configure your subscriptions properly and monitor their activity regularly.

    There are a few possible reasons why this might have happened, such as:

    1. The subscriptions had the AutoDeleteOnIdle property set to a short time span, which means they would be automatically deleted if no client tries to read or write to them for that period of time.
    2. The subscriptions were manually deleted by someone who had access to the topic or the namespace.

    You can use Azure Monitor to monitor the activity logs and metrics of your Service Bus namespace. The activity logs will contain information about the operations performed on your Service Bus resources, such as create, delete, update, etc. You can filter the logs by resource type, operation name, Event Initiated by. The Event Initiated by field will show you the identity of the user or service principal that performed the operation. You can also set up alerts and notifications based on the activity logs and metrics to get notified of any changes in your Service Bus namespace

    https://learn.microsoft.com/en-us/azure/service-bus-messaging/monitor-service-bus

    https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log?tabs=powershell

    I hope this helps! Let me know if you have any further questions.

    Please "Upvote" and "Accept as Answer" if the answer is helpful so that it can help others in the community.