A definiált hatókörre vonatkozó riasztások listája.
GET https://management.azure.com/{scope}/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
URI-paraméterek
| Name |
In |
Kötelező |
Típus |
Description |
|
scope
|
path |
True
|
string
|
A riasztási műveletekhez társított hatókör. Ide tartoznak a resourceGroup-hatókörhöz tartozó "/subscriptions/{subscriptionId}/" előfizetési hatókör, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}", "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}" a számlázási fiók hatóköréhez és a "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}" a részleg hatóköréhez, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{ enrollmentAccountId}" a EnrollmentAccount hatókörhöz, "/providers/Microsoft.Management/managementGroups/{managementGroupId} a felügyeleti csoport hatóköréhez, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" a billingProfile hatókörhöz, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}" a invoiceSection hatókörhöz és a "/providers/Microsoft". Billing/billingAccounts/{billingAccountId}/customers/{customerId}" a partnerekre vonatkozóan.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
A művelethez használandó API-verzió.
|
Válaszok
| Name |
Típus |
Description |
|
200 OK
|
AlertsResult
|
Az Azure-művelet sikeresen befejeződött.
|
|
Other Status Codes
|
ErrorResponse
|
Váratlan hibaválasz.
|
Biztonság
azure_auth
Azure Active Directory OAuth2-folyamat.
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
| Name |
Description |
|
user_impersonation
|
a felhasználói fiók megszemélyesítése
|
Példák
BillingAccountAlerts
Mintakérelem
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python billing_account_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345-6789",
)
print(response)
# x-ms-original-file: 2025-03-01/BillingAccountAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/BillingAccountAlerts.json
func ExampleAlertsClient_List_billingAccountAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345-6789", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/BillingAccountAlerts.json
*/
async function billingAccountAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list("providers/Microsoft.Billing/billingAccounts/12345-6789");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
BillingProfileAlerts
Mintakérelem
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python billing_profile_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579",
)
print(response)
# x-ms-original-file: 2025-03-01/BillingProfileAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/BillingProfileAlerts.json
func ExampleAlertsClient_List_billingProfileAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/BillingProfileAlerts.json
*/
async function billingProfileAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list(
"providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579",
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
DepartmentAlerts
Mintakérelem
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python department_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123",
)
print(response)
# x-ms-original-file: 2025-03-01/DepartmentAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/DepartmentAlerts.json
func ExampleAlertsClient_List_departmentAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/DepartmentAlerts.json
*/
async function departmentAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list(
"providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123",
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
EnrollmentAccountAlerts
Mintakérelem
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python enrollment_account_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456",
)
print(response)
# x-ms-original-file: 2025-03-01/EnrollmentAccountAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/EnrollmentAccountAlerts.json
func ExampleAlertsClient_List_enrollmentAccountAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/EnrollmentAccountAlerts.json
*/
async function enrollmentAccountAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list(
"providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456",
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
InvoiceSectionAlerts
Mintakérelem
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python invoice_section_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876",
)
print(response)
# x-ms-original-file: 2025-03-01/InvoiceSectionAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/InvoiceSectionAlerts.json
func ExampleAlertsClient_List_invoiceSectionAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/InvoiceSectionAlerts.json
*/
async function invoiceSectionAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list(
"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876",
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
ResourceGroupAlerts
Mintakérelem
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python resource_group_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer",
)
print(response)
# x-ms-original-file: 2025-03-01/ResourceGroupAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/ResourceGroupAlerts.json
func ExampleAlertsClient_List_resourceGroupAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/ResourceGroupAlerts.json
*/
async function resourceGroupAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer",
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
SubscriptionAlerts
Mintakérelem
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python subscription_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
print(response)
# x-ms-original-file: 2025-03-01/SubscriptionAlerts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/SubscriptionAlerts.json
func ExampleAlertsClient_List_subscriptionAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](161000.12),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// Amount: to.Ptr[float64](200000),
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// CurrentSpend: to.Ptr[float64](171000.32),
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// Threshold: to.Ptr[float64](0.8),
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to lists the alerts for scope defined.
*
* @summary lists the alerts for scope defined.
* x-ms-original-file: 2025-03-01/SubscriptionAlerts.json
*/
async function subscriptionAlerts() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.alerts.list("subscriptions/00000000-0000-0000-0000-000000000000");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
Definíciók
| Name |
Description |
|
Alert
|
Egyéni riasztás.
|
|
AlertCategory
|
Riasztási kategória
|
|
AlertCriteria
|
Riasztást aktiváló feltételek
|
|
AlertOperator
|
operátor, amely a currentSpend és az összeg összehasonlítására szolgál
|
|
AlertPropertiesDefinition
|
meghatározza a riasztás típusát
|
|
AlertPropertiesDetails
|
Riasztás részletei
|
|
AlertSource
|
Riasztás forrása
|
|
AlertsResult
|
Riasztások eredménye.
|
|
AlertStatus
|
riasztás állapota
|
|
AlertTimeGrainType
|
Időtartomány-ütemezés típusa
|
|
AlertType
|
riasztás típusa
|
|
createdByType
|
Az erőforrást létrehozó identitás típusa.
|
|
ErrorDetails
|
A hiba részletei.
|
|
ErrorResponse
|
A hibaválasz azt jelzi, hogy a szolgáltatás nem tudja feldolgozni a bejövő kérést. Ennek okát a hibaüzenet adja meg. \n\nNéhány hibaválasz: \n\n * 429 TooManyRequests - A kérés korlátozott. Próbálkozzon újra az "x-ms-ratelimit-microsoft.consumption-retry-after" fejlécben megadott időre való várakozás után. \n\n * 503 ServiceUnavailable - A szolgáltatás ideiglenesen nem elérhető. Próbálkozzon újra az "Újrapróbálkozás után" fejlécben megadott időre való várakozás után.
|
|
systemData
|
Az erőforrás létrehozásával és utolsó módosításával kapcsolatos metaadatok.
|
Alert
Tárgy
Egyéni riasztás.
| Name |
Típus |
Description |
|
eTag
|
string
|
Az erőforrás eTagje. Az egyidejű frissítési forgatókönyv kezeléséhez ez a mező határozza meg, hogy a felhasználó frissíti-e a legújabb verziót.
|
|
id
|
string
(arm-id)
|
Az erőforrás teljes erőforrás-azonosítója. Például: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
Az erőforrás neve
|
|
properties.closeTime
|
string
|
dateTime, amelyben a riasztás lezárult
|
|
properties.costEntityId
|
string
|
kapcsolódó költségvetés
|
|
properties.creationTime
|
string
|
dateTime, amelyben a riasztás létrejött
|
|
properties.definition
|
AlertPropertiesDefinition
|
meghatározza a riasztás típusát
|
|
properties.description
|
string
|
Riasztás leírása
|
|
properties.details
|
AlertPropertiesDetails
|
Riasztás részletei
|
|
properties.modificationTime
|
string
|
dateTime, amelyben a riasztás utoljára módosult
|
|
properties.source
|
AlertSource
|
Riasztás forrása
|
|
properties.status
|
AlertStatus
|
riasztás állapota
|
|
properties.statusModificationTime
|
string
|
dateTime, amelyben a riasztás állapota legutóbb módosult
|
|
properties.statusModificationUserName
|
string
|
Felhasználó, aki legutóbb módosította a riasztást
|
|
systemData
|
systemData
|
A createdBy és a modifiedBy adatokat tartalmazó Azure Resource Manager-metaadatok.
|
|
type
|
string
|
Az erőforrás típusa. Pl. "Microsoft.Compute/virtualMachines" vagy "Microsoft.Storage/storageAccounts"
|
AlertCategory
Felsorolás
Riasztási kategória
| Érték |
Description |
|
Cost
|
|
|
Usage
|
|
|
Billing
|
|
|
System
|
|
AlertCriteria
Felsorolás
Riasztást aktiváló feltételek
| Érték |
Description |
|
CostThresholdExceeded
|
|
|
UsageThresholdExceeded
|
|
|
CreditThresholdApproaching
|
|
|
CreditThresholdReached
|
|
|
QuotaThresholdApproaching
|
|
|
QuotaThresholdReached
|
|
|
MultiCurrency
|
|
|
ForecastCostThresholdExceeded
|
|
|
ForecastUsageThresholdExceeded
|
|
|
InvoiceDueDateApproaching
|
|
|
InvoiceDueDateReached
|
|
|
CrossCloudNewDataAvailable
|
|
|
CrossCloudCollectionError
|
|
|
GeneralThresholdError
|
|
AlertOperator
Felsorolás
operátor, amely a currentSpend és az összeg összehasonlítására szolgál
| Érték |
Description |
|
None
|
|
|
EqualTo
|
|
|
GreaterThan
|
|
|
GreaterThanOrEqualTo
|
|
|
LessThan
|
|
|
LessThanOrEqualTo
|
|
AlertPropertiesDefinition
Tárgy
meghatározza a riasztás típusát
AlertPropertiesDetails
Tárgy
Riasztás részletei
| Name |
Típus |
Description |
|
amount
|
number
(decimal)
|
költségvetési küszöbérték összege
|
|
companyName
|
string
|
cégnév
|
|
contactEmails
|
string[]
|
a kapcsolattartó e-mailjeinek listája
|
|
contactGroups
|
string[]
|
azoknak a műveletcsoportoknak a listája,
|
|
contactRoles
|
string[]
|
partneri szerepkörök listája
|
|
currentSpend
|
number
(decimal)
|
aktuális költés
|
|
departmentName
|
string
|
részleg neve
|
|
enrollmentEndDate
|
string
|
a enrollmentEndDate dátumideje
|
|
enrollmentNumber
|
string
|
regisztrációs szám
|
|
enrollmentStartDate
|
string
|
a regisztráció dátumidejeStartDate
|
|
invoicingThreshold
|
number
(decimal)
|
számlázási küszöbérték
|
|
meterFilter
|
MeterFilter[]
|
mérők tömbje, amely alapján szűrni kell
|
|
operator
|
AlertOperator
|
operátor, amely a currentSpend és az összeg összehasonlítására szolgál
|
|
overridingAlert
|
string
|
felülrekedő riasztás
|
|
periodStartDate
|
string
|
a periodStartDate dátumideje
|
|
resourceFilter
|
ResourceFilter[]
|
a szűrni kívánt erőforrások tömbje
|
|
resourceGroupFilter
|
ResourceGroupFilter[]
|
resourceGroups tömbje, amely alapján szűrni szeretne
|
|
tagFilter
|
|
címkék, amelyeket szűrni szeretne
|
|
threshold
|
number
(decimal)
|
értesítési küszöbérték százalékos értéke tizedes törtként, amely aktiválta ezt a riasztást
|
|
timeGrainType
|
AlertTimeGrainType
|
Időtartomány-ütemezés típusa
|
|
triggeredBy
|
string
|
értesítésazonosító, amely aktiválta ezt a riasztást
|
|
unit
|
string
|
használt pénznemegység
|
AlertSource
Felsorolás
Riasztás forrása
| Érték |
Description |
|
Preset
|
|
|
User
|
|
AlertsResult
Tárgy
Riasztások eredménye.
| Name |
Típus |
Description |
|
nextLink
|
string
|
URL-cím a következő riasztási eredmények lekéréséhez, ha vannak ilyenek.
|
|
value
|
Alert[]
|
Riasztások listája.
|
AlertStatus
Felsorolás
riasztás állapota
| Érték |
Description |
|
None
|
|
|
Active
|
|
|
Overridden
|
|
|
Resolved
|
|
|
Dismissed
|
|
AlertTimeGrainType
Felsorolás
Időtartomány-ütemezés típusa
| Érték |
Description |
|
None
|
|
|
Monthly
|
|
|
Quarterly
|
|
|
Annually
|
|
|
BillingMonth
|
|
|
BillingQuarter
|
|
|
BillingAnnual
|
|
AlertType
Felsorolás
riasztás típusa
| Érték |
Description |
|
Budget
|
|
|
Invoice
|
|
|
Credit
|
|
|
Quota
|
|
|
General
|
|
|
xCloud
|
|
|
BudgetForecast
|
|
createdByType
Felsorolás
Az erőforrást létrehozó identitás típusa.
| Érték |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorDetails
Tárgy
A hiba részletei.
| Name |
Típus |
Description |
|
code
|
string
|
Hibakód.
|
|
message
|
string
|
A művelet sikertelen voltát jelző hibaüzenet.
|
ErrorResponse
Tárgy
A hibaválasz azt jelzi, hogy a szolgáltatás nem tudja feldolgozni a bejövő kérést. Ennek okát a hibaüzenet adja meg. \n\nNéhány hibaválasz: \n\n * 429 TooManyRequests - A kérés korlátozott. Próbálkozzon újra az "x-ms-ratelimit-microsoft.consumption-retry-after" fejlécben megadott időre való várakozás után. \n\n * 503 ServiceUnavailable - A szolgáltatás ideiglenesen nem elérhető. Próbálkozzon újra az "Újrapróbálkozás után" fejlécben megadott időre való várakozás után.
systemData
Tárgy
Az erőforrás létrehozásával és utolsó módosításával kapcsolatos metaadatok.
| Name |
Típus |
Description |
|
createdAt
|
string
(date-time)
|
Az erőforrás-létrehozás időbélyege (UTC).
|
|
createdBy
|
string
|
Az erőforrást létrehozó identitás.
|
|
createdByType
|
createdByType
|
Az erőforrást létrehozó identitás típusa.
|
|
lastModifiedAt
|
string
(date-time)
|
Az erőforrás utolsó módosításának időbélyege (UTC)
|
|
lastModifiedBy
|
string
|
Az erőforrást legutóbb módosító identitás.
|
|
lastModifiedByType
|
createdByType
|
Az erőforrást legutóbb módosító identitás típusa.
|