Did you mark it as a Spot instance while creating the VM? can you check in the acitivity logs if its shuts down at roughly the same time or random times & what service is stopping it?
Also you can redeploy your VM. When you redeploy a VM, Azure will shut down the VM, move the VM to a new node within the Azure infrastructure, and then power it back on, retaining all your configuration options and associated resources. It resolves the issues on your VM if they are due to a problematic physical host.
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/redeploy-to-new-node-windows