An Azure service that is used to provision Windows and Linux virtual machines.
Faris Ali
If your Linux VM is shutting down automatically every 15–20 minutes and no auto‑shutdown schedule is configured, this behavior is typically caused by platform recovery actions (host/infrastructure issues) or guest OS‑initiated shutdowns. Please follow the structured troubleshooting steps below to identify the root cause.
Step 1: Check Azure Activity Log (Most Important)
This confirms whether the shutdown is customer‑initiated (Portal/CLI/Automation/Policy) or Azure platform‑initiated.
Azure Portal VM > Activity log
Filter for:
- Stop Virtual Machine
- Deallocate Virtual Machine
- Check Initiated by field (User / Managed Identity / Automation / Azure platform)
az monitor activity-log list \
--resource-id <VM_RESOURCE_ID> \
--status Succeeded \
--max-events 50 \
--query "[?operationName.value=='Microsoft.Compute/virtualMachines/deallocate/action']"
Ref documentation - https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log?tabs=log-analytics
Step 2 : Azure provides a supported diagnostic flow that can surface Root Cause Analysis (RCA).
Path
- VM > Help + troubleshooting
- Diagnose and solve problems
- Common problems > VM restarted or stopped unexpectedly
- Select “My resource has been stopped unexpectedly”
Note: If the issue is platform‑related, Resource Health may publish RCA details up to 72 hours after the event.
For unexpected VM restarts/stops: https://learn.microsoft.com/troubleshoot/azure/virtual-machines/windows/unexpected-vm-reboot-root-cause-analysis
Step 3 : Check Azure Resource Health
This confirms host‑level faults, service healing, or unexpected downtime.
VM > Resource health
Review past health events around shutdown times
Understand VM reboots & service healing: https://learn.microsoft.com/azure/virtual-machines/understand-vm-reboots
Step 4 : Check Linux OS‑Level Logs
If Azure logs do not show a deallocate event, the shutdown may be guest OS‑initiated (kernel panic, OOM kill, crash).
Run inside the VM (or via Serial Console if SSH drops):
# Check previous shutdown reasons
sudo journalctl -b -1 -e
# Look for shutdown / crash events
sudo journalctl | grep -i -E "shutdown|panic|oom|error|critical"
# Check kernel messages
sudo dmesg | tail -100
Step 5: Check Azure Linux Agent Health
# Check agent status
systemctl status walinuxagent || systemctl status waagent
# Update agent (Ubuntu/Debian)
sudo apt update
sudo apt install walinuxagent -y
sudo systemctl restart walinuxagent
# Validate version
waagent --version
Troubleshoot the Azure Linux Agent - https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/linux-azure-guest-agent
Update Linux Agent: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/update-linux-agent?tabs=ubuntu
Step 6: Redeploy the VM (If Host Issue Suspected)
If shutdowns continue and Activity Log / Resource Health indicates infrastructure instability, Redeploy moves the VM to a new Azure host without changing disks or configuration.
From Azure Portal - VM > Help + troubleshooting
Redeploy + reapply and then Redeploy
az vm redeploy \
--resource-group <RG_NAME> \
--name <VM_NAME>
Note: Temporary disk data will be lost. OS and data disks remain intact.
Redeploy Windows virtual machine to new Azure node - https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/redeploy-to-new-node-windows
Regards
Himanshu