Hi @Catherine Du ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
According to the official Azure Service Bus documentation, scheduled messages are included in duplicate detection. The duplicate detection window starts from the time the message is enqueued and lasts for the duration specified by the user. Therefore, if you send a scheduled message and then send a duplicate non-scheduled message, the non-scheduled message gets dropped. Similarly, if you send a non-scheduled message and then a duplicate scheduled message, the scheduled message is dropped.
Regarding your question, the duplicate detection applies to the scheduled message at the time it is enqueued, not at the scheduled time. So, in your example, if you schedule a message to be enqueued at 5:15 PM and the duplicate detection window is set to 5 minutes, any duplicate message sent between 5:15 PM and 5:20 PM will be dropped.
I hope this helps! Let me know if you have any other questions.
Thankyou.