Skip to content

Commit ee92e8c

Browse files
committed
MCM - Update budget tutorial CLI example
1 parent efbaf9e commit ee92e8c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

articles/cost-management-billing/costs/tutorial-acm-create-budgets.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Tutorial - Create and manage budgets
33
description: This tutorial helps you plan and account for the costs of Azure services that you consume.
44
author: bandersmsft
55
ms.author: banders
6-
ms.date: 04/25/2024
6+
ms.date: 07/09/2024
77
ms.topic: tutorial
88
ms.service: cost-management-billing
99
ms.subservice: cost-management
@@ -224,18 +224,19 @@ The following example creates a budget using Azure CLI. Make sure to replace all
224224
```azurecli
225225
# Sign into Azure CLI with your account
226226
az login
227-
227+
228228
# Select a subscription to monitor with a budget
229229
az account set --subscription "Your Subscription"
230-
230+
231231
# Create an action group email receiver and corresponding action group
232232
email1=$(az monitor action-group receiver email create --email-address [email protected] --name EmailReceiver1 --resource-group YourResourceGroup --query id -o tsv)
233233
ActionGroupId=$(az monitor action-group create --resource-group YourResourceGroup --name TestAG --short-name TestAG --receiver $email1 --query id -o tsv)
234-
234+
235235
# Create a monthly budget that sends an email and triggers an Action Group to send a second email.
236236
# Make sure the StartDate for your monthly budget is set to the first day of the current month.
237237
# Note that Action Groups can also be used to trigger automation such as Azure Functions or Webhooks.
238-
az consumption budget create --amount 100 --name TestCLIBudget --category Cost --start-date "2020-02-01" --time-grain Monthly --end-date "2022-12-31" --contact-email [email protected] --notification-key Key1 --notification-threshold 0.8 --notification-enabled --contact-group $ActionGroupId
238+
239+
az consumption budget create-with-rg --amount 100 --budget-name TestCLIBudget -g $rg --category Cost --time-grain Monthly --time-period '{"start-date":"2024-06-01","end-date":"2025-12-31"}' --notifications "{\"Key1\":{\"enabled\":\"true\", \"operator\":\"GreaterThanOrEqualTo\", \"contact-emails\":[], \"threshold\":80.0, \"contact-groups\":[\"$ActionGroupId\"]}}"
239240
```
240241

241242
### [Terraform](#tab/tfbudget)

0 commit comments

Comments
 (0)