There's a number of things you can do to find what the issue is:
- Check the Event logs locally on the VM, they should point to when the VM rebooted and the issues that led up to it. Look for event id 1074.
- Set up Performance Monitor and run a data collector set to see of you can establish what the issue is:
- Enable Log Analytics on both the VM and also install the Azure Monitor agent on the VM to send data to your Log Analytics Workspace. You can set up alerts based on the data received to show you when the VM is restarting:
- Enable Serial Console on the VM to get a view of what is happening:
Hope this helps,
- If the reply was helpful please upvote and/or accept as answer as this helps others in the community with similar questions. Thanks!