简体   繁体   中英

alert on azure cost before budget has been reached

Background:

I've been searching for a way to properly monitor and create alerting on Azure cost for a resource group. All current monitoring and alerting seem to be related to budgets. You can set a budget, and can create alerts when you have spent more than x percent of that budget. However, suppose that I configure something wrong and create a resource that costs way too much money, and I burn through my monthly budget within a week. Now I will get an alert after a week, but the damage to my bill will already have been done.

What I am looking for: I'd like to have some way of alerting if my daily spending shows some abnormal behavior (or I've spent more than x dollar/euro/whatever currency in the last day, of the last x days). This way, I can proactively react to wrong settings, and not only react once I've burned up my budget.

What I already tried:

  • I looked for a built in way, but there doesn't seem to be one.
  • I tried to use azure powershell or the API to export by resource group's cost, but the Azure Powershell billing methods seem to be broken (see this thread ), and the API's documentation is a mess. There are like a million ways of fetching billing data, but none of them seem to work properly or return any usable data for my situation.

My specific question:

I'm looking for a way to fetch the current billing period's cost overview, either via the API, or azure powershell, so I can import it and create my own alerts. However if somebody can provide an alternative approach to accomplish my goal your answer is also welcome

Note the 1st answer was accurate, but I think you may not have made it to the second tab, Set alerts, where you can choose to set an alert at a percentage of the budget you just set up. See the Set alerts screen below.

I had a similar question, and you might have had the same concern. The resource manager has already set a budget, and I don't want to set a new budget, just an alert. So you can choose to Add a new budget if you wish, but you may also be able to:

  1. Go to Budgets to find existing, primary budget
  2. Select Edit budget (verify this accurately reflects your real/total budget)
  3. Click on Set alerts
  4. Create alerts as a percentage of the budget

I read that Azure allows you to go over budget. This month, my team went over budget, I want to keep the service open and am hoping for cheaper future months. To ensure things don't really get out of control, I've set up new, far-over-budget alerts. So for example, I now have 50, 90, 100, 200, and 300% alerts.

Set alerts tab within Create Budget screen

You can try the steps as below:

1.In azure portal, nav to your resource group.

2.In the left pane -> Cost Management -> Cost alerts(preivew) -> then click the Add button:

在此处输入图像描述

3.In the new page, fill in all the fields in 1. Create a budget and 2. Set alerts tab:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM