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:
- 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.
- 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.