Azure GetBudget

Azure GetBudget

Certified

Get one Azure Consumption budget

Calls the Consumption Budgets - Get API and returns the budget with its amount, current spend and forecasted spend.

yaml
type: io.kestra.plugin.azure.billing.GetBudget

Fail the flow when a budget's current spend is above its amount.

yaml
id: azure_check_budget
namespace: company.finops

tasks:
  - id: budget
    type: io.kestra.plugin.azure.billing.GetBudget
    scope: "/subscriptions/{{ secret('AZURE_SUBSCRIPTION_ID') }}"
    budgetName: monthly-total

  - id: check
    type: io.kestra.plugin.core.execution.Fail
    condition: "{{ (outputs.budget.budget.currentSpendAmount ?? 0) > outputs.budget.budget.amount }}"
    errorMessage: "Budget monthly-total exceeded: {{ outputs.budget.budget.currentSpendAmount }} {{ outputs.budget.budget.currentSpendUnit }}"

pluginDefaults:
  - type: io.kestra.plugin.azure
    values:
      tenantId: "{{ secret('AZURE_TENANT_ID') }}"
      clientId: "{{ secret('AZURE_CLIENT_ID') }}"
      clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
Properties

Budget name

Name of the budget to get. Letters, digits, ., _ and - only.

Scope

Azure scope the costs or budgets belong to, for example /subscriptions/{subscriptionId}, /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}, /providers/Microsoft.Management/managementGroups/{managementGroupId} or /providers/Microsoft.Billing/billingAccounts/{billingAccountId}.

Azure AD tenant ID (GUID)

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Client ID of the Azure AD application

Application (client) ID used for service principal authentication.

Client secret for the Azure AD application

Secret value associated with the client ID; store in a Kestra secret.

PEM-encoded certificate content for client authentication

PEM text for certificate-based auth; alternative to clientSecret.

Budget

The budget with name, id, category, amount, timeGrain, startDate/endDate, currentSpendAmount/currentSpendUnit, forecastSpendAmount/forecastSpendUnit, and notifications, each with name, enabled, operator, threshold, thresholdType, contactEmails, contactRoles and contactGroups.