@A M Apologies for the delay in response and all the inconvenience caused because of the issue.
Scheduled Events is an Azure Metadata Service that gives your application time to prepare for virtual machine (VM) maintenance. It provides information about upcoming maintenance events (for example, reboot) so that your application can prepare for them and limit disruption. It's available for all Azure Virtual Machines types, including PaaS and IaaS on both Windows and Linux.
As mentioned here you can make use of below to query VM:
curl -H Metadata:true http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01
You can refer to this as well to understand how to use script to achieve same.
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.