Alerts - List External

Lists the Alerts for external cloud provider type defined.

GET https://management.azure.com/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts?api-version=2023-11-01

URI Parameters

Name In Required Type Description
externalCloudProviderId
path True

string

This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.

externalCloudProviderType
path True

externalCloudProviderType

The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

AlertsResult

OK. The request has succeeded.

Other Status Codes

ErrorResponse

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

ExternalBillingAccountAlerts
ExternalSubscriptionAlerts

ExternalBillingAccountAlerts

Sample Request

GET https://management.azure.com/providers/Microsoft.CostManagement/externalBillingAccounts/100/alerts?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.CostManagement/externalBillingAccounts/100/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
      "name": "00000000-0000-0000-0000-000000000000",
      "type": "Microsoft.CostManagement/alerts",
      "properties": {
        "definition": {
          "type": "Budget",
          "category": "Cost",
          "criteria": "CostThresholdExceeded"
        },
        "description": "",
        "source": "Preset",
        "details": {
          "timeGrainType": "Quarterly",
          "periodStartDate": "2020-03-01T00:00:00Z",
          "triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
          "resourceGroupFilter": [],
          "resourceFilter": [],
          "meterFilter": [],
          "tagFilter": {},
          "threshold": 0.8,
          "operator": "GreaterThan",
          "amount": 200000,
          "unit": "USD",
          "currentSpend": 161000.12,
          "contactEmails": [
            "1234@contoso.com"
          ],
          "contactGroups": [],
          "contactRoles": [],
          "overridingAlert": null
        },
        "costEntityId": "budget1",
        "status": "Active",
        "creationTime": "2020-04-27T11:07:52.7143901Z",
        "closeTime": "0001-01-01T00:00:00",
        "modificationTime": "2020-04-28T11:06:02.8999373Z",
        "statusModificationUserName": null,
        "statusModificationTime": "0001-01-01T00:00:00"
      }
    },
    {
      "id": "providers/Microsoft.CostManagement/externalBillingAccounts/100/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
      "name": "11111111-1111-1111-111111111111",
      "type": "Microsoft.CostManagement/alerts",
      "properties": {
        "definition": {
          "type": "Budget",
          "category": "Cost",
          "criteria": "CostThresholdExceeded"
        },
        "description": "",
        "source": "Preset",
        "details": {
          "timeGrainType": "Quarterly",
          "periodStartDate": "2020-03-01T00:00:00Z",
          "triggeredBy": "11111111-1111-1111-111111111111_1_01",
          "resourceGroupFilter": [],
          "resourceFilter": [],
          "meterFilter": [],
          "tagFilter": {},
          "threshold": 0.8,
          "operator": "GreaterThan",
          "amount": 200000,
          "unit": "USD",
          "currentSpend": 171000.32,
          "contactEmails": [
            "1234@contoso.com"
          ],
          "contactGroups": [],
          "contactRoles": [],
          "overridingAlert": null
        },
        "costEntityId": "budget1",
        "status": "Active",
        "creationTime": "2019-06-24T05:51:52.8713179Z",
        "closeTime": "0001-01-01T00:00:00",
        "modificationTime": "2019-08-31T17:51:55.1808807Z",
        "statusModificationUserName": null,
        "statusModificationTime": "0001-01-01T00:00:00"
      }
    }
  ],
  "nextLink": null
}

ExternalSubscriptionAlerts

Sample Request

GET https://management.azure.com/providers/Microsoft.CostManagement/externalSubscriptions/100/alerts?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.CostManagement/externalSubscriptions/100/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
      "name": "00000000-0000-0000-0000-000000000000",
      "type": "Microsoft.CostManagement/alerts",
      "properties": {
        "definition": {
          "type": "Budget",
          "category": "Cost",
          "criteria": "CostThresholdExceeded"
        },
        "description": "",
        "source": "Preset",
        "details": {
          "timeGrainType": "Quarterly",
          "periodStartDate": "2020-03-01T00:00:00Z",
          "triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
          "resourceGroupFilter": [],
          "resourceFilter": [],
          "meterFilter": [],
          "tagFilter": {},
          "threshold": 0.8,
          "operator": "GreaterThan",
          "amount": 200000,
          "unit": "USD",
          "currentSpend": 161000.12,
          "contactEmails": [
            "1234@contoso.com"
          ],
          "contactGroups": [],
          "contactRoles": [],
          "overridingAlert": null
        },
        "costEntityId": "budget1",
        "status": "Active",
        "creationTime": "2020-04-27T11:07:52.7143901Z",
        "closeTime": "0001-01-01T00:00:00",
        "modificationTime": "2020-04-28T11:06:02.8999373Z",
        "statusModificationUserName": null,
        "statusModificationTime": "0001-01-01T00:00:00"
      }
    },
    {
      "id": "providers/Microsoft.CostManagement/externalSubscriptions/100/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
      "name": "11111111-1111-1111-111111111111",
      "type": "Microsoft.CostManagement/alerts",
      "properties": {
        "definition": {
          "type": "Budget",
          "category": "Cost",
          "criteria": "CostThresholdExceeded"
        },
        "description": "",
        "source": "Preset",
        "details": {
          "timeGrainType": "Quarterly",
          "periodStartDate": "2020-03-01T00:00:00Z",
          "triggeredBy": "11111111-1111-1111-111111111111_1_01",
          "resourceGroupFilter": [],
          "resourceFilter": [],
          "meterFilter": [],
          "tagFilter": {},
          "threshold": 0.8,
          "operator": "GreaterThan",
          "amount": 200000,
          "unit": "USD",
          "currentSpend": 171000.32,
          "contactEmails": [
            "1234@contoso.com"
          ],
          "contactGroups": [],
          "contactRoles": [],
          "overridingAlert": null
        },
        "costEntityId": "budget1",
        "status": "Active",
        "creationTime": "2019-06-24T05:51:52.8713179Z",
        "closeTime": "0001-01-01T00:00:00",
        "modificationTime": "2019-08-31T17:51:55.1808807Z",
        "statusModificationUserName": null,
        "statusModificationTime": "0001-01-01T00:00:00"
      }
    }
  ],
  "nextLink": null
}

Definitions

Name Description
Alert

An individual alert.

AlertCategory

Alert category

AlertCriteria

Criteria that triggered alert

AlertOperator

operator used to compare currentSpend with amount

AlertSource

Source of alert

AlertsResult

Result of alerts.

AlertStatus

alert status

AlertTimeGrainType

Type of timegrain cadence

AlertType

type of alert

Definition

defines the type of alert

Details

Alert details

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.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

externalCloudProviderType

The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.

TagFilter

tags to filter by

Alert

An individual alert.

Name Type Description
eTag

string

eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.

id

string

Resource Id.

name

string

Resource name.

properties.closeTime

string

dateTime in which alert was closed

properties.costEntityId

string

related budget

properties.creationTime

string

dateTime in which alert was created

properties.definition

Definition

defines the type of alert

properties.description

string

Alert description

properties.details

Details

Alert details

properties.modificationTime

string

dateTime in which alert was last modified

properties.source

AlertSource

Source of alert

properties.status

AlertStatus

alert status

properties.statusModificationTime

string

dateTime in which the alert status was last modified

properties.statusModificationUserName

string

User who last modified the alert

type

string

Resource type.

AlertCategory

Alert category

Name Type Description
Billing

string

Cost

string

System

string

Usage

string

AlertCriteria

Criteria that triggered alert

Name Type Description
CostThresholdExceeded

string

CreditThresholdApproaching

string

CreditThresholdReached

string

CrossCloudCollectionError

string

CrossCloudNewDataAvailable

string

ForecastCostThresholdExceeded

string

ForecastUsageThresholdExceeded

string

GeneralThresholdError

string

InvoiceDueDateApproaching

string

InvoiceDueDateReached

string

MultiCurrency

string

QuotaThresholdApproaching

string

QuotaThresholdReached

string

UsageThresholdExceeded

string

AlertOperator

operator used to compare currentSpend with amount

Name Type Description
EqualTo

string

GreaterThan

string

GreaterThanOrEqualTo

string

LessThan

string

LessThanOrEqualTo

string

None

string

AlertSource

Source of alert

Name Type Description
Preset

string

User

string

AlertsResult

Result of alerts.

Name Type Description
nextLink

string

URL to get the next set of alerts results if there are any.

value

Alert[]

List of alerts.

AlertStatus

alert status

Name Type Description
Active

string

Dismissed

string

None

string

Overridden

string

Resolved

string

AlertTimeGrainType

Type of timegrain cadence

Name Type Description
Annually

string

BillingAnnual

string

BillingMonth

string

BillingQuarter

string

Monthly

string

None

string

Quarterly

string

AlertType

type of alert

Name Type Description
Budget

string

BudgetForecast

string

Credit

string

General

string

Invoice

string

Quota

string

xCloud

string

Definition

defines the type of alert

Name Type Description
category

AlertCategory

Alert category

criteria

AlertCriteria

Criteria that triggered alert

type

AlertType

type of alert

Details

Alert details

Name Type Description
amount

number

budget threshold amount

companyName

string

company name

contactEmails

string[]

list of emails to contact

contactGroups

string[]

list of action groups to broadcast to

contactRoles

string[]

list of contact roles

currentSpend

number

current spend

departmentName

string

department name

enrollmentEndDate

string

datetime of enrollmentEndDate

enrollmentNumber

string

enrollment number

enrollmentStartDate

string

datetime of enrollmentStartDate

invoicingThreshold

number

invoicing threshold

meterFilter

AlertProperties.details.MeterFilter[]

array of meters to filter by

operator

AlertOperator

operator used to compare currentSpend with amount

overridingAlert

string

overriding alert

periodStartDate

string

datetime of periodStartDate

resourceFilter

AlertProperties.details.ResourceFilter[]

array of resources to filter by

resourceGroupFilter

AlertProperties.details.ResourceGroupFilter[]

array of resourceGroups to filter by

tagFilter

TagFilter

tags to filter by

threshold

number

notification threshold percentage as a decimal which activated this alert

timeGrainType

AlertTimeGrainType

Type of timegrain cadence

triggeredBy

string

notificationId that triggered this alert

unit

string

unit of currency being used

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.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

Name Type Description
error

ErrorDetails

The details of the error.

externalCloudProviderType

The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.

Name Type Description
externalBillingAccounts

string

externalSubscriptions

string

TagFilter

tags to filter by