Alerts - Get

Gets the alert for the scope by alert ID.

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

URI Parameters

Name In Required Type Description
alertId
path True

string

Alert ID

scope
path True

string

The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

Alert

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

SingleResourceGroupAlerts
SingleSubscriptionAlerts

SingleResourceGroupAlerts

Sample request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222?api-version=2023-11-01

Sample response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222",
  "name": "22222222-2222-2222-2222-222222222222",
  "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": "22222222-2222-2222-2222-222222222222_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"
  }
}

SingleSubscriptionAlerts

Sample request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222?api-version=2023-11-01

Sample response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222",
  "name": "22222222-2222-2222-2222-222222222222",
  "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": "22222222-2222-2222-2222-222222222222_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"
  }
}

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

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.

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

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.

TagFilter

tags to filter by