Skip to main content

alerts

Creates, updates, deletes, gets or lists an alerts resource.

Overview

Namealerts
TypeResource
Idazure.cost_management.alerts

Fields

The following fields are returned by SELECT queries:

OK. The request has succeeded.

NameDatatypeDescription
idstringResource Id.
namestringResource name.
eTagstringeTag 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.
propertiesobjectAlert properties. (title: Alert properties)
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, alertIdGets the alert for the scope by alert ID.
listselectscopeLists the alerts for scope defined.
dismissexecscope, alertIdDismisses the specified alert

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
alertIdstringAlert ID
scopestringThe 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.

SELECT examples

Gets the alert for the scope by alert ID.

SELECT
id,
name,
eTag,
properties,
type
FROM azure.cost_management.alerts
WHERE scope = '{{ scope }}' -- required
AND alertId = '{{ alertId }}' -- required
;

Lifecycle Methods

Dismisses the specified alert

EXEC azure.cost_management.alerts.dismiss 
@scope='{{ scope }}' --required,
@alertId='{{ alertId }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;