Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft/Consumption cannot toggle thresholdType in budgets #16240

Closed
stephybun opened this issue Sep 30, 2021 · 3 comments
Closed

Microsoft/Consumption cannot toggle thresholdType in budgets #16240

stephybun opened this issue Sep 30, 2021 · 3 comments
Labels
Consumption - Budget All issues in consumption for Budgets API, Alert API and other Notification scenarios. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@stephybun
Copy link

As of 15.03.2021 thresholdType can accept the values Actual and Forecasted, but it doesn't seem possible to toggle between the two with API calls.

Here is our HTTP PUT Request after we created a budget with thresholdType = Forecasted

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/swacctestbudget-30921?api-version=2019-10-01

{
  "properties": {
    "amount": "3000",
    "category": "Cost",
    "filter": {},
    "notifications": {
      "actual_GreaterThan_95_Percent": {
        "enabled": true,
        "operator": "GreaterThan",
        "threshold": "95",
        "contactEmails": [
          "[email protected]"
        ],
        "contactRoles": [],
        "contactGroups": [],
        "thresholdType": "Actual"
      }
    },
    "timeGrain": "Monthly",
    "timePeriod": {
      "startDate": "2021-09-01T00:00:00Z",
      "endDate": "2022-10-01T00:00:00Z"
    }
  }
}

And we receive a 200 with the following response

{
    "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/swacctestbudget-30921",
    "name": "swacctestbudget-30921",
    "type": "Microsoft.Consumption/budgets",
    "eTag": "\"1d7b5ed4fab3297\"",
    "properties": {
        "timePeriod": {
            "startDate": "2021-09-01T00:00:00Z",
            "endDate": "2022-10-01T00:00:00Z"
        },
        "timeGrain": "Monthly",
        "amount": 3000.0,
        "currentSpend": null,
        "category": "Cost",
        "notifications": {
            "actual_GreaterThan_95_Percent": {
                "enabled": true,
                "operator": "GreaterThan",
                "threshold": 95.00,
                "contactEmails": [
                    "[email protected]"
                ],
                "contactRoles": [],
                "contactGroups": [],
                "thresholdType": "Forecasted"
            }
        },
        "filter": {}
    }
}

In addition the Swagger Spec for thresholdType only lists Actual even though Forecasted is still accepted:

"thresholdType": {
"description": "The type of threshold",
"type": "string",
"enum": [
"Actual"
],
"x-ms-enum": {
"name": "ThresholdType",
"modelAsString": true
},
"default": "Actual"
},

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 30, 2021
@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 30, 2021
@leniatgh leniatgh added Consumption Service Attention Workflow: This issue is responsible by Azure service team. labels Oct 9, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 9, 2021
@ghost
Copy link

ghost commented Oct 9, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ms-premp.

Issue Details

As of 15.03.2021 thresholdType can accept the values Actual and Forecasted, but it doesn't seem possible to toggle between the two with API calls.

Here is our HTTP PUT Request after we created a budget with thresholdType = Forecasted

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/swacctestbudget-30921?api-version=2019-10-01

{
  "properties": {
    "amount": "3000",
    "category": "Cost",
    "filter": {},
    "notifications": {
      "actual_GreaterThan_95_Percent": {
        "enabled": true,
        "operator": "GreaterThan",
        "threshold": "95",
        "contactEmails": [
          "[email protected]"
        ],
        "contactRoles": [],
        "contactGroups": [],
        "thresholdType": "Actual"
      }
    },
    "timeGrain": "Monthly",
    "timePeriod": {
      "startDate": "2021-09-01T00:00:00Z",
      "endDate": "2022-10-01T00:00:00Z"
    }
  }
}

And we receive a 200 with the following response

{
    "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/swacctestbudget-30921",
    "name": "swacctestbudget-30921",
    "type": "Microsoft.Consumption/budgets",
    "eTag": "\"1d7b5ed4fab3297\"",
    "properties": {
        "timePeriod": {
            "startDate": "2021-09-01T00:00:00Z",
            "endDate": "2022-10-01T00:00:00Z"
        },
        "timeGrain": "Monthly",
        "amount": 3000.0,
        "currentSpend": null,
        "category": "Cost",
        "notifications": {
            "actual_GreaterThan_95_Percent": {
                "enabled": true,
                "operator": "GreaterThan",
                "threshold": 95.00,
                "contactEmails": [
                    "[email protected]"
                ],
                "contactRoles": [],
                "contactGroups": [],
                "thresholdType": "Forecasted"
            }
        },
        "filter": {}
    }
}

In addition the Swagger Spec for thresholdType only lists Actual even though Forecasted is still accepted:

"thresholdType": {
"description": "The type of threshold",
"type": "string",
"enum": [
"Actual"
],
"x-ms-enum": {
"name": "ThresholdType",
"modelAsString": true
},
"default": "Actual"
},

Author: stephybun
Assignees: jianyexi
Labels:

question, Consumption, Service Attention, customer-reported, needs-triage

Milestone: -

@ShilpiGautam ShilpiGautam added Consumption - Budget All issues in consumption for Budgets API, Alert API and other Notification scenarios. and removed Consumption labels Oct 11, 2021
@ccmaxpcrew
Copy link

We are presently investigating this.

@ccmaxpcrew
Copy link

ccmaxpcrew commented Oct 14, 2021

Hi @stephybun. From the request body, I noticed the notification name as "actual_GreaterThan_95_Percent". Was this name different from the previous notification name? As long as new name is different from the previous notification name, it should work. Let us know if you are noticing a different behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Consumption - Budget All issues in consumption for Budgets API, Alert API and other Notification scenarios. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants