Hello salman khan, your VM is configured as a Spot VM, and unexpected shutdowns are expected behavior due to the nature of Spot allocation in Azure.
Based on the details you've shared so far I can see your VM is defined with the following properties- "priority": "Spot", "evictionPolicy": "Deallocate" and "billingProfile": { "maxPrice": -1}
These settings indicate your VM is a Spot instance, which is evicted automatically by Azure when there is insufficient capacity in your selected region or zone as Azure prioritizes regular (pay-as-you-go) VMs
The Spot price exceeds your max price (in your case, -1 means "always accept current price")
This is why your APIs suddenly went down and the VM was deallocated without notice, and this bypasses the auto-shutdown setting. If you want consistency with your VM then go for pay as you go VMs.
Reference document- https://learn.microsoft.com/en-us/azure/virtual-machines/spot-vms#eviction-policy
Hope I was able to clear your query here. It would be great if you could kindly accept the answer so that anyone else having similar query on MS QnA forum can refer to it. Thanks