Skip to main content

budgets

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

Overview

Namebudgets
TypeResource
Idazure.cost_management.budgets

Fields

NameDatatypeDescription
idtextResource Id.
nametextResource name.
amounttextfield from the properties object
budgetNametextfield from the properties object
categorytextfield from the properties object
current_spendtextfield from the properties object
e_tagtextfield from the properties object
filtertextfield from the properties object
forecast_spendtextfield from the properties object
notificationstextfield from the properties object
scopetextfield from the properties object
time_graintextfield from the properties object
time_periodtextfield from the properties object
typetextResource type.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbudgetName, scopeGets the budget for the scope by budget name.
listSELECTscopeLists all budgets for the defined scope.
create_or_updateINSERTbudgetName, scopeThe 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.
deleteDELETEbudgetName, scopeThe operation to delete a budget.

SELECT examples

Lists all budgets for the defined scope.

SELECT
id,
name,
amount,
budgetName,
category,
current_spend,
e_tag,
filter,
forecast_spend,
notifications,
scope,
time_grain,
time_period,
type
FROM azure.cost_management.vw_budgets
WHERE scope = '{{ scope }}';

INSERT example

Use the following StackQL query and manifest file to create a new budgets resource.

/*+ create */
INSERT INTO azure.cost_management.budgets (
budgetName,
scope,
eTag,
properties
)
SELECT
'{{ budgetName }}',
'{{ scope }}',
'{{ eTag }}',
'{{ properties }}'
;

DELETE example

Deletes the specified budgets resource.

/*+ delete */
DELETE FROM azure.cost_management.budgets
WHERE budgetName = '{{ budgetName }}'
AND scope = '{{ scope }}';