Skip to main content

budgets

Creates, updates, deletes, gets or lists a budgets resource.

Overview

Namebudgets
TypeResource
Idazure.cost_management.budgets

Fields

The following fields are returned by SELECT queries:

OK. The request has succeeded.

NameDatatypeDescription
idstringResource Id.
namestringResource name.
eTagstringeTag 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.
propertiesobjectThe properties of the budget. (title: Budget properties)
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, budgetNameGets the budget for the scope by budget name.
listselectscope$filterLists all budgets for the defined scope.
create_or_updateinsertscope, budgetNameThe 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.
deletedeletescope, budgetNameThe 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.

NameDatatypeDescription
budgetNamestringBudget Name.
scopestringThe 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)
$filterstringOData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' only.

SELECT examples

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
;

INSERT examples

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
;

DELETE examples

The operation to delete a budget.

DELETE FROM azure.cost_management.budgets
WHERE scope = '{{ scope }}' --required
AND budgetName = '{{ budgetName }}' --required
;