Dear Bimala,
Thank you for bringing this issue to our attention. Unexpected shutdowns due to the Azure Linux agent can indeed disrupt operations, and I understand the need for a reliable solution to minimize manual intervention. Am I right? if so pls check the Azure Linux Agent Status Connect to the VM via SSH and run
systemctl status waagent
If the agent is inactive, restart it
systemctl restart waagent
next review Agent Logs for Errors Investigate the logs to identify the root cause
sudo apt update && sudo apt upgrade -y walinuxagent
Update the Azure Linux Agent Ensure the latest version is installed for exampple for Ubuntu/Debian
sudo apt update && sudo apt upgrade -y walinuxagent
for RHEL/CentOS
sudo yum update -y WALinuxAgent
Enable Auto-Recovery Features in Azure
- Configure Auto-shutdown (if applicable) in the Azure Portal under VM > Settings > Auto-shutdown.
- Set up Azure Monitor Alerts to notify you of unexpected shutdowns.
Automate VM Recovery
- Use Azure Automation to trigger automatic restarts if the agent fails.
- Implement a custom watchdog script to monitor and restart the agent if needed.
- Schedule regular maintenance windows to update the VM and agent.
- Ensure backups are configured via Azure Backup for quick recovery if needed.
If the issue persists after these steps, may be need to reinstall the VM agent or consider redeploying the VM while preserving the disks.
Best regards,
Alex
P.S. If my answer help to you, please Accept my answer