To set up a daily budget alert in Azure, follow these steps:
- Create a Log Analytics Workspace:
- Go to the Azure portal and create a Log Analytics workspace if you don’t have one
- Enable Cost Management Data:
- In the Log Analytics workspace, enable the Cost Management data connector to ingest cost data. 3. Create a Custom Log Search Alert:
- Go to Azure Monitor and select “Alerts”.
- Go to Azure Monitor and select “Alerts”.
- Click on “+ New alert rule”.
- Set the scope to your subscription or resource group.
- For the condition, use a custom log search query to check daily costs. Example query:
Usage
| where TimeGenerated >= startofday(now())
| summarize TotalCost = sum(Cost) by bin(TimeGenerated, 1d)
| where TotalCost > {your-threshold}
- Set the frequency and action group for notifications.