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:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
closeTimestringdateTime in which alert was closed.
costEntityIdstringrelated budget.
creationTimestringdateTime in which alert was created.
definitionobjectdefines the type of alert.
descriptionstringAlert description.
detailsobjectAlert details.
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.
modificationTimestringdateTime in which alert was last modified.
sourcestringSource of alert. Known values are: "Preset" and "User". (Preset, User)
statusstringalert status. Known values are: "None", "Active", "Overridden", "Resolved", and "Dismissed". (None, Active, Overridden, Resolved, Dismissed)
statusModificationTimestringdateTime in which the alert status was last modified.
statusModificationUserNamestringUser who last modified the alert.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, alert_idGets the alert for the scope by alert ID.
list_externalselectexternal_cloud_provider_type, external_cloud_provider_idLists the Alerts for external cloud provider type defined.
listselectscopeLists the alerts for scope defined.
dismissexecscope, alert_idDismisses 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
alert_idstringAlert ID. Required.
external_cloud_provider_idstringThis can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. Required.
external_cloud_provider_typestringThe external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions" and "externalBillingAccounts". Required.
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.

SELECT examples

Gets the alert for the scope by alert ID.

SELECT
id,
name,
closeTime,
costEntityId,
creationTime,
definition,
description,
details,
eTag,
modificationTime,
source,
status,
statusModificationTime,
statusModificationUserName,
systemData,
type
FROM azure.cost_management.alerts
WHERE scope = '{{ scope }}' -- required
AND alert_id = '{{ alert_id }}' -- required
;

Lifecycle Methods

Dismisses the specified alert.

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