budgets
Creates, updates, deletes, gets or lists a budgets
resource.
Overview
Name | budgets |
Type | Resource |
Id | azure.cost_management.budgets |
Fields
The following fields are returned by SELECT
queries:
- get
- list
OK. The request has succeeded.
Name | Datatype | Description |
---|---|---|
id | string | Resource Id. |
name | string | Resource name. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
properties | object | The properties of the budget. (title: Budget properties) |
type | string | Resource type. |
OK. The request has succeeded.
Name | Datatype | Description |
---|---|---|
id | string | Resource Id. |
name | string | Resource name. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
properties | object | The properties of the budget. (title: Budget properties) |
type | string | Resource type. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | scope , budgetName | Gets the budget for the scope by budget name. | |
list | select | scope | $filter | Lists all budgets for the defined scope. |
create_or_update | insert | scope , budgetName | The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. | |
delete | delete | scope , budgetName | The operation to delete a budget. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
budgetName | string | Budget Name. |
scope | string | The scope associated with budget operations. Supported scopes for CategoryType: Cost Azure RBAC Scopes: - '/subscriptions/{subscriptionId}/' for subscription scope - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope EA (Enterprise Agreement) Scopes: - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope MCA (Modern Customer Agreement) Scopes: - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only) Supported scopes for CategoryType: ReservationUtilization EA (Enterprise Agreement) Scopes: - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope MCA (Modern Customer Agreement) Scopes: - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only) - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only) |
$filter | string | OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' only. |
SELECT
examples
- get
- list
Gets the budget for the scope by budget name.
SELECT
id,
name,
eTag,
properties,
type
FROM azure.cost_management.budgets
WHERE scope = '{{ scope }}' -- required
AND budgetName = '{{ budgetName }}' -- required
;
Lists all budgets for the defined scope.
SELECT
id,
name,
eTag,
properties,
type
FROM azure.cost_management.budgets
WHERE scope = '{{ scope }}' -- required
AND $filter = '{{ $filter }}'
;
INSERT
examples
- create_or_update
- Manifest
The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation.
INSERT INTO azure.cost_management.budgets (
data__eTag,
data__properties,
scope,
budgetName
)
SELECT
'{{ eTag }}',
'{{ properties }}',
'{{ scope }}',
'{{ budgetName }}'
RETURNING
id,
name,
eTag,
properties,
type
;
# Description fields are for documentation purposes
- name: budgets
props:
- name: scope
value: string
description: Required parameter for the budgets resource.
- name: budgetName
value: string
description: Required parameter for the budgets resource.
- name: eTag
value: string
description: |
eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
- name: properties
value: object
description: |
The properties of the budget.
DELETE
examples
- delete
The operation to delete a budget.
DELETE FROM azure.cost_management.budgets
WHERE scope = '{{ scope }}' --required
AND budgetName = '{{ budgetName }}' --required
;