external help file | Module Name | online version | schema |
---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.Consumption.dll-Help.xml |
Az.Billing |
2.0.0 |
Update a budget in either a subscription or a resource group.
Set-AzConsumptionBudget [-DefaultProfile <IAzureContextContainer>] -Name <String> [-Amount <Decimal>]
[-Category <String>] [-TimeGrain <String>] [-StartDate <DateTime>] [-EndDate <DateTime>]
[-ResourceGroupName <String>] [-MeterFilter <String[]>] [-ResourceFilter <String[]>]
[-ResourceGroupFilter <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-AzConsumptionBudget [-DefaultProfile <IAzureContextContainer>] -Name <String> [-Amount <Decimal>]
[-Category <String>] [-TimeGrain <String>] [-StartDate <DateTime>] [-EndDate <DateTime>]
[-ResourceGroupName <String>] [-MeterFilter <String[]>] [-ResourceFilter <String[]>]
[-ResourceGroupFilter <String[]>] -NotificationKey <String> [-NotificationEnabled]
[-NotificationThreshold <Decimal>] [-ContactEmail <String[]>] [-ContactGroup <String[]>]
[-ContactRole <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-AzConsumptionBudget [-DefaultProfile <IAzureContextContainer>] -InputObject <PSBudget> [-Amount <Decimal>]
[-Category <String>] [-TimeGrain <String>] [-StartDate <DateTime>] [-EndDate <DateTime>]
[-MeterFilter <String[]>] [-ResourceFilter <String[]>] [-ResourceGroupFilter <String[]>] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-AzConsumptionBudget [-DefaultProfile <IAzureContextContainer>] -InputObject <PSBudget> [-Amount <Decimal>]
[-Category <String>] [-TimeGrain <String>] [-StartDate <DateTime>] [-EndDate <DateTime>]
[-MeterFilter <String[]>] [-ResourceFilter <String[]>] [-ResourceGroupFilter <String[]>]
-NotificationKey <String> [-NotificationEnabled] [-NotificationThreshold <Decimal>] [-ContactEmail <String[]>]
[-ContactGroup <String[]>] [-ContactRole <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
The Set-AzConsumptionBudget cmdlet updates a budget in either a subscription or a resource group.
Set-AzConsumptionBudget -Name PSBudget -Amount 75
Amount: 75
Category: Cost
CurrentSpend: null
Id: subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/providers/Microsoft.Consumption/budgets/PSBudget
Name: PSBudget
TimeGrain: Monthly
TimePeriod: EndDate: 11/1/2018 12:00:00 AM
StartDate: 6/1/2018 12:00:00 AM
Type: Microsoft.Consumption/budgets
Example 2: Update a budget with a notification when cost or usage reaches a threshold of 90 percent of amount at subscription level
Set-AzConsumptionBudget -Name PSBudget -NotificationKey notificationKey-ps1234 -NotificationEnabled -NotificationThreshold 90 -ContactEmail @('johndoe@contoso.com','janesmith@contoso.com') -ContactRole Owner,Reader,Contributor
Amount: 75
Category: Cost
CurrentSpend: null
Id: subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/providers/Microsoft.Consumption/budgets/PSBudget
Name: PSBudget
Notification: NotificationKey: notificationKey-ps1234
Threshold: 90
Enabled: true
ContactEmail: johndoe@contoso.com,janesmith@contoso.com
ContactRole: Owner,Reader,Contributor
TimeGrain: Monthly
TimePeriod: EndDate: 11/1/2018 12:00:00 AM
StartDate: 6/1/2018 12:00:00 AM
Type: Microsoft.Consumption/budgets
Set-AzConsumptionBudget -ResourceGroupName RGBudgets -Name PSBudgetRG -Amount 75
Amount: 75
Category: Cost
CurrentSpend: null
Id: subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/resourceGroups/RGBudgets/providers/Microsoft.Consumption/budgets/PSBudgetRG
Name: PSBudgetRG
TimeGrain: Monthly
TimePeriod: EndDate: 11/1/2018 12:00:00 AM
StartDate: 6/1/2018 12:00:00 AM
Type: Microsoft.Consumption/budgets
Amount of a budget.
Type: System.Nullable`1[System.Decimal]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Category of the budget can be cost or usage.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Cost, Usage
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Email addresses to send the budget notification to when the threshold is exceeded.
Type: System.String[]
Parameter Sets: Notification, Piping and Notification
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Action groups to send the budget notification to when the threshold is exceeded.
Type: System.String[]
Parameter Sets: Notification, Piping and Notification
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Contact roles to send the budget notification to when the threshold is exceeded.
Type: System.String[]
Parameter Sets: Notification, Piping and Notification
Aliases:
Accepted values: Owner, Reader, Contributor
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The credentials, account, tenant, and subscription used for communication with Azure.
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
End date (YYYY-MM-DD in UTC) of time period of a budget.
Type: System.Nullable`1[System.DateTime]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Budget object.
Type: Microsoft.Azure.Commands.Consumption.Models.PSBudget
Parameter Sets: Piping, Piping and Notification
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Comma-separated list of meters to filter on. Required if category is usage.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Name of a budget.
Type: System.String
Parameter Sets: Subscription, Notification
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The notification is enabled. If not specified, the notification is disabled by default.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: Notification, Piping and Notification
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Key of a notification associated with a budget, required to create a notification with notification enabled switch, notification threshold, contact emails, contact groups, or contact roles.
Type: System.String
Parameter Sets: Notification, Piping and Notification
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Threshold value associated with a notification. Notification is sent when the cost or usage exceeded the threshold. It is always percent and has to be between 0 and 1000.
Type: System.Nullable`1[System.Decimal]
Parameter Sets: Notification, Piping and Notification
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Comma-separated list of resource instances to filter on.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Comma-separated list of resource groups to filter on.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Resource Group of a budget.
Type: System.String
Parameter Sets: Subscription, Notification
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Start date (YYYY-MM-DD in UTC) of time period of a budget. Not prior to current month for monthly time grain. Not prior to three months for quarterly time grain. Not prior to twelve months for yearly time grain. Future start date not more than three months.
Type: System.Nullable`1[System.DateTime]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Time grain of the budget can be monthly, quarterly, or annually.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Monthly, Quarterly, Annually
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
- Currently, PowerShell SDK for Consumption is only available to Enterprise Agreement customers.
- PowerShell SDK for Consumption is using an older version of Budgets API and few backwards non-compatible items like listing Budgets with filters will not work as expected.