Budgets in Cost Management help you plan for and drive organizational accountability. With budgets, you can account for the Azure services you consume or subscribe to during a specific period. They help you inform others about their spending to proactively manage costs, and to monitor how spending progresses over time. When the budget thresholds you've created are exceeded, notifications are triggered. None of your resources are affected and your consumption isn't stopped. You can use budgets to compare and track spending as you analyze costs. This quickstart shows you how to create a budget using three different Azure Resource Manager templates (ARM template).
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button for one of the following templates. The template will open in the Azure portal.
If you have a new subscription, you can't immediately create a budget or use other Cost Management features. It might take up to 48 hours before you can use all Cost Management features.
To view budgets, you need at least read access for your Azure account.
For Azure EA subscriptions, you must have read access to view budgets. To create and manage budgets, you must have contributor permission.
The following Azure permissions, or scopes, are supported per subscription for budgets by user and group. For more information about scopes, see Understand and work with scopes.
Use one of the following templates, based on your needs.
Review the template
The template used in this quickstart is from Azure Quickstart Templates.
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.5.6.12127",
"templateHash": "15851432186142062555"
}
},
"parameters": {
"budgetName": {
"type": "string",
"defaultValue": "MyBudget",
"metadata": {
"description": "Name of the Budget. It should be unique within a resource group."
}
},
"amount": {
"type": "int",
"defaultValue": 1000,
"metadata": {
"description": "The total amount of cost or usage to track with the budget"
}
},
"timeGrain": {
"type": "string",
"defaultValue": "Monthly",
"allowedValues": [
"Monthly",
"Quarterly",
"Annually"
],
"metadata": {
"description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain."
}
},
"startDate": {
"type": "string",
"metadata": {
"description": "The start date must be first of the month in YYYY-MM-DD format. Future start date should not be more than three months. Past start date should be selected within the timegrain preiod."
}
},
"endDate": {
"type": "string",
"metadata": {
"description": "The end date for the budget in YYYY-MM-DD format. If not provided, we default this to 10 years from the start date."
}
},
"firstThreshold": {
"type": "int",
"defaultValue": 90,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"secondThreshold": {
"type": "int",
"defaultValue": 110,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"contactEmails": {
"type": "array",
"metadata": {
"description": "The list of email addresses to send the budget notification to when the threshold is exceeded."
}
}
},
"resources": [
{
"type": "Microsoft.Consumption/budgets",
"apiVersion": "2021-10-01",
"name": "[parameters('budgetName')]",
"properties": {
"timePeriod": {
"startDate": "[parameters('startDate')]",
"endDate": "[parameters('endDate')]"
},
"timeGrain": "[parameters('timeGrain')]",
"amount": "[parameters('amount')]",
"category": "Cost",
"notifications": {
"NotificationForExceededBudget1": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('firstThreshold')]",
"contactEmails": "[parameters('contactEmails')]"
},
"NotificationForExceededBudget2": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('secondThreshold')]",
"contactEmails": "[parameters('contactEmails')]"
}
}
}
}
]
}
One Azure resource is defined in the template:
Deploy the template
Select the following image to sign in to Azure and open a template. The template creates a budget without any filters.
Select or enter the following values.
- Subscription: select an Azure subscription.
- Resource group: if required, select an existing resource group, or Create new.
- Region: select an Azure region. For example, China North.
- Budget Name: enter a name for the budget. It should be unique within a resource group. Only alphanumeric, underscore, and hyphen characters are allowed.
- Amount: enter the total amount of cost to track with the budget.
- Time Grain: enter the time covered by a budget. Allowed values are Monthly, Quarterly, or Annually. The budget resets at the end of the time grain.
- Start Date: enter the start date with the first day of the month in YYYY-MM-DD format. A future start date shouldn't be more than three months from today. You can specify a past start date with the Time Grain period.
- End Date: enter the end date for the budget in YYYY-MM-DD format.
- First Threshold: enter a threshold value for the first notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Second Threshold: enter a threshold value for the second notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Contact Emails enter a list of email addresses to send the budget notification to when a threshold is exceeded. It accepts an array of strings. Expected format is
["user1@domain.com","user2@domain.com"]
.
Depending on your Azure subscription type, do one of the following actions:
- Select Review + create.
- Review the terms and conditions, select I agree to the terms and conditions stated above, and then select Purchase.
If you selected Review + create, your template is validated. Select Create.
The Azure portal is used to deploy the template. In addition to the Azure portal, you can also use Azure PowerShell, Azure CLI, and REST API. To learn about other deployment templates, see Deploy templates.
Review the template
The template used in this quickstart is from Azure Quickstart Templates.
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.5.6.12127",
"templateHash": "16839077498193926768"
}
},
"parameters": {
"budgetName": {
"type": "string",
"defaultValue": "MyBudget",
"metadata": {
"description": "Name of the Budget. It should be unique within a resource group."
}
},
"amount": {
"type": "int",
"defaultValue": 1000,
"metadata": {
"description": "The total amount of cost or usage to track with the budget"
}
},
"timeGrain": {
"type": "string",
"defaultValue": "Monthly",
"allowedValues": [
"Monthly",
"Quarterly",
"Annually"
],
"metadata": {
"description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain."
}
},
"startDate": {
"type": "string",
"metadata": {
"description": "The start date must be first of the month in YYYY-MM-DD format. Future start date should not be more than three months. Past start date should be selected within the timegrain preiod."
}
},
"endDate": {
"type": "string",
"metadata": {
"description": "The end date for the budget in YYYY-MM-DD format. If not provided, we default this to 10 years from the start date."
}
},
"firstThreshold": {
"type": "int",
"defaultValue": 90,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"secondThreshold": {
"type": "int",
"defaultValue": 110,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"contactEmails": {
"type": "array",
"metadata": {
"description": "The list of email addresses to send the budget notification to when the threshold is exceeded."
}
},
"resourceGroupFilterValues": {
"type": "array",
"metadata": {
"description": "The set of values for the resource group filter."
}
}
},
"resources": [
{
"type": "Microsoft.Consumption/budgets",
"apiVersion": "2021-10-01",
"name": "[parameters('budgetName')]",
"properties": {
"timePeriod": {
"startDate": "[parameters('startDate')]",
"endDate": "[parameters('endDate')]"
},
"timeGrain": "[parameters('timeGrain')]",
"amount": "[parameters('amount')]",
"category": "Cost",
"notifications": {
"NotificationForExceededBudget1": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('firstThreshold')]",
"contactEmails": "[parameters('contactEmails')]"
},
"NotificationForExceededBudget2": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('secondThreshold')]",
"contactEmails": "[parameters('contactEmails')]"
}
},
"filter": {
"dimensions": {
"name": "ResourceGroupName",
"operator": "In",
"values": "[parameters('resourceGroupFilterValues')]"
}
}
}
}
]
}
One Azure resource is defined in the template:
Deploy the template
Select the following image to sign in to Azure and open a template. The template creates a budget with a filter for resource groups.
Select or enter the following values.
- Subscription: select an Azure subscription.
- Resource group: if required, select an existing resource group, or Create new.
- Region: select an Azure region. For example, China North.
- Budget Name: enter a name for the budget. It should be unique within a resource group. Only alphanumeric, underscore, and hyphen characters are allowed.
- Amount: enter the total amount of cost to track with the budget.
- Time Grain: enter the time covered by a budget. Allowed values are Monthly, Quarterly, or Annually. The budget resets at the end of the time grain.
- Start Date: enter the start date with the first day of the month in YYYY-MM-DD format. A future start date shouldn't be more than three months from today. You can specify a past start date with the Time Grain period.
- End Date: enter the end date for the budget in YYYY-MM-DD format.
- First Threshold: enter a threshold value for the first notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Second Threshold: enter a threshold value for the second notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Contact Emails enter a list of email addresses to send the budget notification to when a threshold is exceeded. It accepts an array of strings. Expected format is
["user1@domain.com","user2@domain.com"]
.
- Resource Group Filter Values enter a list of resource group names to filter. It accepts an array of strings. Expected format is
["Resource Group Name1","Resource Group Name2"]
. The array can't be empty.
Depending on your Azure subscription type, do one of the following actions:
- Select Review + create.
- Review the terms and conditions, select I agree to the terms and conditions stated above, and then select Purchase.
If you selected Review + create, your template is validated. Select Create.
The Azure portal is used to deploy the template. In addition to the Azure portal, you can also use Azure PowerShell, Azure CLI, and REST API. To learn about other deployment templates, see Deploy templates.
Review the template
The template used in this quickstart is from Azure Quickstart Templates.
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.8.9.13224",
"templateHash": "16562188350105885076"
}
},
"parameters": {
"budgetName": {
"type": "string",
"defaultValue": "MyBudget",
"metadata": {
"description": "Name of the Budget. It should be unique within a resource group."
}
},
"amount": {
"type": "int",
"defaultValue": 1000,
"metadata": {
"description": "The total amount of cost or usage to track with the budget"
}
},
"timeGrain": {
"type": "string",
"defaultValue": "Monthly",
"allowedValues": [
"Monthly",
"Quarterly",
"Annually"
],
"metadata": {
"description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain."
}
},
"startDate": {
"type": "string",
"metadata": {
"description": "The start date must be first of the month in YYYY-MM-DD format. Future start date should not be more than three months. Past start date should be selected within the timegrain preiod."
}
},
"endDate": {
"type": "string",
"metadata": {
"description": "The end date for the budget in YYYY-MM-DD format. If not provided, we default this to 10 years from the start date."
}
},
"firstThreshold": {
"type": "int",
"defaultValue": 90,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"secondThreshold": {
"type": "int",
"defaultValue": 110,
"metadata": {
"description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0.01 and 1000."
}
},
"contactRoles": {
"type": "array",
"defaultValue": [
"Owner",
"Contributor",
"Reader"
],
"metadata": {
"description": "The list of contact roles to send the budget notification to when the threshold is exceeded."
}
},
"contactEmails": {
"type": "array",
"metadata": {
"description": "The list of email addresses to send the budget notification to when the threshold is exceeded."
}
},
"contactGroups": {
"type": "array",
"metadata": {
"description": "The list of action groups to send the budget notification to when the threshold is exceeded. It accepts array of strings."
}
},
"resourceGroupFilterValues": {
"type": "array",
"metadata": {
"description": "The set of values for the resource group filter."
}
},
"meterCategoryFilterValues": {
"type": "array",
"metadata": {
"description": "The set of values for the meter category filter."
}
}
},
"resources": [
{
"type": "Microsoft.Consumption/budgets",
"apiVersion": "2021-10-01",
"name": "[parameters('budgetName')]",
"properties": {
"timePeriod": {
"startDate": "[parameters('startDate')]",
"endDate": "[parameters('endDate')]"
},
"timeGrain": "[parameters('timeGrain')]",
"amount": "[parameters('amount')]",
"category": "Cost",
"notifications": {
"NotificationForExceededBudget1": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('firstThreshold')]",
"contactEmails": "[parameters('contactEmails')]",
"contactRoles": "[parameters('contactRoles')]",
"contactGroups": "[parameters('contactGroups')]"
},
"NotificationForExceededBudget2": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('secondThreshold')]",
"contactEmails": "[parameters('contactEmails')]",
"contactRoles": "[parameters('contactRoles')]",
"contactGroups": "[parameters('contactGroups')]",
"thresholdType": "Forecasted"
}
},
"filter": {
"and": [
{
"dimensions": {
"name": "ResourceGroupName",
"operator": "In",
"values": "[parameters('resourceGroupFilterValues')]"
}
},
{
"dimensions": {
"name": "MeterCategory",
"operator": "In",
"values": "[parameters('meterCategoryFilterValues')]"
}
}
]
}
}
}
]
}
One Azure resource is defined in the template:
Deploy the template
Select the following image to sign in to Azure and open a template. The template creates a budget with a filter for resource groups and a filter for meter categories.
Select or enter the following values.
- Subscription: select an Azure subscription.
- Resource group: if required, select an existing resource group, or Create new.
- Region: select an Azure region. For example, Central US.
- Budget Name: enter a name for the budget. It should be unique within a resource group. Only alphanumeric, underscore, and hyphen characters are allowed.
- Amount: enter the total amount of cost to track with the budget.
- Time Grain: enter the time covered by a budget. Allowed values are Monthly, Quarterly, or Annually. The budget resets at the end of the time grain.
- Start Date: enter the start date with the first day of the month in YYYY-MM-DD format. A future start date shouldn't be more than three months from today. You can specify a past start date with the Time Grain period.
- End Date: enter the end date for the budget in YYYY-MM-DD format.
- First Threshold: enter a threshold value for the first notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Second Threshold: enter a threshold value for the second notification. A notification is sent when the cost exceeds the threshold. It's always percent and has to be between 0.01 and 1000.
- Contact Roles enter the list of contact roles to send the budget notification to when the threshold is exceeded. Default values are Owner, Contributor, and Reader. Expected format is
["Owner","Contributor","Reader"]
.
- Contact Emails enter a list of email addresses to send the budget notification to when a threshold is exceeded. It accepts an array of strings. Expected format is
["user1@domain.com","user2@domain.com"]
.
- Contact Groups enter a list of action group resource IDs, as a full resource URIs, to send the budget notification to when the threshold is exceeded. It accepts an array of strings. Expected format is
["action group resource ID1","action group resource ID2"]
. If don't want to use action groups, enter []
.
- Resource Group Filter Values enter a list of resource group names to filter. It accepts an array of strings. Expected format is
["Resource Group Name1","Resource Group Name2"]
. The array can't be empty.
- Meter Category Filter Values enter a list of Azure service meter categories. It accepts an array of strings. Expected format is
["Meter Category1","Meter Category2"]
. The array can't be empty.
Depending on your Azure subscription type, do one of the following actions:
- Select Review + create.
- Review the terms and conditions, select I agree to the terms and conditions stated above, and then select Purchase.
If you selected Review + create, your template is validated. Select Create.
The Azure portal is used to deploy the template. In addition to the Azure portal, you can also use Azure PowerShell, Azure CLI, and REST API. To learn about other deployment templates, see Deploy templates.
Use one of the following ways to verify that the budget is created.
In this quickstart, you created a budget and deployed it. To learn more about Cost Management and Billing and Azure Resource Manager, continue on to the articles below.