I need to create an alert that will notify me on DAILY basis if my Subscription exceeds a DAILY allowed threshold.
The closest thing i have found is within Cost Management, you can either:
I have found this link on line which explains on how you can ingest Cost Data into your Log Analytics Workspace, and then create alert based on that data using a query. But I am having hard times following the step where you supposed to enable Cost Management data connector within the Loq Analytics Workspace, the Data or Connectors Blade/Option is missing within my existing log analytics workspace.
https://learn.microsoft.com/en-us/answers/questions/2120587/daily-budget-alerts
Any idea on how to set up a daily cost alert based on a condition for a whole subscription within Azure ?
Thank you all in advance.
As you mentioned, the cost alerts available in cost management Azure is anomaly and budget alerts as shown below. These alerts are used to receive alert mails when the specified budget or cost limits has been reached the threshold.
Coming to your requirement, to set up a daily alert based on a condition for the complete subscription firstly you need to get or export the cost management data using connectors or Rest API into a csv file. From there, upload it to the storage account and then link it to the Log analytics workspace to retrieve the logs.
Refer Ms Doc to ingest cost management data.
Once it is done, go to the workspace >> logs and use Usage query table with the required condition. You can also refer this blog for the conditional based usage query.
Usage
| where StartTime >= startofday(ago(30d)) and EndTime < startofday(now())
| where IsBillable == true
| summarize BillableData = sum(Quantity) / 1000. by bin(StartTime, 1d), DataType
After clicking on New alert rule
, it redirects you to the page where it has a custom log search selected under signal name and provide the alert related details like action group, threshold accordingly.