Forecasts - List

Lists the forecast charges by subscriptionId.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts?api-version=2019-10-01
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts?$filter={$filter}&api-version=2019-10-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Azure Subscription ID.

$filter
query
  • string

May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.

api-version
query True
  • string

Version of the API to be used with the client request. The current version is 2019-10-01.

Responses

Name Type Description
200 OK

OK. The request has succeeded.

Other Status Codes

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ForecastsList
ForecastsListFilterByDates
ForecastsListFilterByGrain

ForecastsList

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/forecasts?api-version=2019-10-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId1",
      "name": "forecastId1",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-04-01",
        "grain": "Daily",
        "charge": 752,
        "currency": "USD",
        "chargeType": "Actual",
        "confidenceLevels": null
      }
    },
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId2",
      "name": "forecastId2",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-04-02",
        "grain": "Daily",
        "charge": 753.809074,
        "currency": "USD",
        "chargeType": "Forecast",
        "confidenceLevels": [
          {
            "percentage": 95,
            "bound": "Upper",
            "value": 1165.951737
          },
          {
            "percentage": 95,
            "bound": "Lower",
            "value": 340.753404
          }
        ]
      }
    }
  ]
}

ForecastsListFilterByDates

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/forecasts?$filter=usagedate ge '2018-04-01' AND usagedate le '2018-04-02'&api-version=2019-10-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId1",
      "name": "forecastId1",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-04-01",
        "grain": "Daily",
        "charge": 752,
        "currency": "USD",
        "chargeType": "Actual",
        "confidenceLevels": null
      }
    },
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId2",
      "name": "forecastId2",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-04-02",
        "grain": "Daily",
        "charge": 753.809074,
        "currency": "USD",
        "chargeType": "Forecast",
        "confidenceLevels": [
          {
            "percentage": 95,
            "bound": "Upper",
            "value": 1165.951737
          },
          {
            "percentage": 95,
            "bound": "Lower",
            "value": 340.753404
          }
        ]
      }
    }
  ]
}

ForecastsListFilterByGrain

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/forecasts?$filter=Grain eq 'Monthly'&api-version=2019-10-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId1",
      "name": "forecastId1",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-04-01",
        "grain": "Monthly",
        "charge": 752,
        "currency": "USD",
        "chargeType": "Actual",
        "confidenceLevels": null
      }
    },
    {
      "id": "/subscriptions/subid/providers/Microsoft.Consumption/forecasts/forecastId2",
      "name": "forecastId2",
      "type": "Microsoft.Consumption/forecasts",
      "properties": {
        "usageDate": "2018-05-01",
        "grain": "Monthly",
        "charge": 753.809074,
        "currency": "USD",
        "chargeType": "Forecast",
        "confidenceLevels": [
          {
            "percentage": 95,
            "bound": "Upper",
            "value": 1165.951737
          },
          {
            "percentage": 95,
            "bound": "Lower",
            "value": 340.753404
          }
        ]
      }
    }
  ]
}

Definitions

Bound

The boundary of the percentage, values could be 'Upper' or 'Lower'

ChargeType

The type of the charge. Could be actual or forecast

ConfidenceLevels

The details about the forecast confidence levels. This is populated only when chargeType is Forecast.

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Forecast

A forecast resource.

ForecastsListResult

Result of listing forecasts. It contains a list of available forecasts.

Grain

The granularity of forecast.

Bound

The boundary of the percentage, values could be 'Upper' or 'Lower'

Name Type Description
Lower
  • string
Upper
  • string

ChargeType

The type of the charge. Could be actual or forecast

Name Type Description
Actual
  • string
Forecast
  • string

ConfidenceLevels

The details about the forecast confidence levels. This is populated only when chargeType is Forecast.

Name Type Description
bound

The boundary of the percentage, values could be 'Upper' or 'Lower'

percentage
  • number

The percentage level of the confidence

value
  • number

The amount of forecast within the percentage level

ErrorDetails

The details of the error.

Name Type Description
code
  • string

Error code.

message
  • string

Error message indicating why the operation failed.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Name Type Description
error

The details of the error.

Forecast

A forecast resource.

Name Type Description
id
  • string

Resource Id.

name
  • string

Resource name.

properties.charge
  • number

The amount of charge

properties.chargeType

The type of the charge. Could be actual or forecast

properties.confidenceLevels

The details about the forecast confidence levels. This is populated only when chargeType is Forecast.

properties.currency
  • string

The ISO currency in which the meter is charged, for example, USD.

properties.grain

The granularity of forecast.

properties.usageDate
  • string

The usage date of the forecast.

tags
  • object

Resource tags.

type
  • string

Resource type.

ForecastsListResult

Result of listing forecasts. It contains a list of available forecasts.

Name Type Description
value

The list of forecasts.

Grain

The granularity of forecast.

Name Type Description
Daily
  • string
Monthly
  • string
Yearly
  • string