To enable notifications for VM deallocation in Azure, you can create an activity log alert. Here's a step-by-step guide on how to set it up:
1. Access Azure Portal: Log into the Azure portal and navigate to the Monitor section.
2. Create an Alert Rule:
- Click on Alerts and then New alert rule.
- Select the Scope for your entire subscription or specific resource group.
- Choose Activity Log as the Signal Type.
3. Configure Signal Logic:
- In the Condition section, select Administrative Activity Log.
- Set the Event source to `Microsoft.Compute/virtualMachines`.
- Choose the event type as `Deallocate Virtual Machine`.
- Ensure the Event level is set to `Any`, and the Status is also set to `Any`. You can choose any initiator for the event.
4. Create an Action Group:
- Click on Add action group and select the notification options such as Email, SMS, or Webhook.
- Configure the notification details as needed.
5. Save the Alert Rule:
- Once all settings are configured, save the alert rule. This will trigger notifications whenever a VM is deallocated within your specified scope.
By following these steps, you can effectively set up notifications for VM deallocation events in Azure. This method ensures you receive timely alerts whenever a VM is deallocated, helping you manage your resources more efficiently.
Citations:
[1] https://stackoverflow.com/questions/74200229/azure-alert-to-notify-when-a-vm-is-stopped
[2] https://learn.microsoft.com/en-us/azure/azure-monitor/vm/monitor-virtual-machine-alerts
[3] https://luke.geek.nz/2022/05/12/deallocate-stopped-virtual-machines-using-azure-automation/
[4] https://build5nines.com/properly-shutdown-azure-vm-to-save-money/
[5] https://www.peterschen.de/excluding-deallocated-vms-from-availability-alerting-3o3/
[6] https://davidalzamendi.com/start-and-stop-azure-vm/
[7] https://learn.microsoft.com/en-us/azure/virtual-machines/maintenance-notifications
[8] https://support.controlup.com/docs/azure-integration-administration
[9] https://www.techtarget.com/searchcloudcomputing/tutorial/How-to-monitor-and-deallocate-Azure-VMs-to-save-money
[10] https://trendmicro.com/cloudoneconformity/knowledge-base/azure/ActivityLog/deallocate-virtual-machine.html