
Azure Forecast
CertifiedForecast Azure spend with Cost Management
Azure Forecast
Forecast Azure spend with Cost Management
Calls the Cost Management Forecast - Usage API on a scope for an explicit period and returns the daily
forecast and its total. Forecast only supports a custom period with daily granularity, so there is no
timeframe or granularity to choose.
type: io.kestra.plugin.azure.billing.ForecastExamples
Forecast the actual cost of the next 30 days and log it.
id: azure_cost_forecast
namespace: company.finops
tasks:
- id: forecast
type: io.kestra.plugin.azure.billing.Forecast
scope: "/subscriptions/{{ secret('AZURE_SUBSCRIPTION_ID') }}"
costType: ActualCost
startDate: "{{ now() | date('yyyy-MM-dd') }}"
endDate: "{{ now() | dateAdd(30, 'DAYS') | date('yyyy-MM-dd') }}"
aggregation: Cost
- id: log_forecast
type: io.kestra.plugin.core.log.Log
message: "Forecast for the next 30 days: {{ outputs.forecast.totalAmount }} {{ outputs.forecast.unit }}"
pluginDefaults:
- type: io.kestra.plugin.azure
values:
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
Properties
aggregation *string
Aggregation column
Required. Cost column to forecast, for example Cost or PreTaxCost.
costType *string
ActualCostAmortizedCostUsageCost type
Required. ActualCost, AmortizedCost or Usage.
endDate *string
End date
Last day of the forecast period, inclusive like in the Cost Management API, as yyyy-MM-dd.
scope *string
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}.
startDate *string
Start date
First day of the forecast period, inclusive, as yyyy-MM-dd.
tenantId *string
Azure AD tenant ID (GUID)
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150clientId string
Client ID of the Azure AD application
Application (client) ID used for service principal authentication.
clientSecret string
Client secret for the Azure AD application
Secret value associated with the client ID; store in a Kestra secret.
includeActualCost booleanstring
falseInclude actual cost
Also return the actual cost of the days of the period that are already over.
pemCertificate string
PEM-encoded certificate content for client authentication
PEM text for certificate-based auth; alternative to clientSecret.
Outputs
forecast array
Forecast by day
One entry per day, keyed by the column names returned by Azure, e.g. Cost, UsageDate, CostStatus (Forecast or Actual), Currency.
totalAmount number
Forecasted total
Sum of the forecasted (non-Actual) entries of the aggregation column. Null when the entries are in more than one currency: use totalAmountByCurrency then.
totalAmountByCurrency object
Forecasted total by currency
Sum of the forecasted (non-Actual) entries per value of the Currency column, e.g. totalAmountByCurrency.EUR.
unit string
Currency
Currency of the forecast, e.g. USD or EUR. Null when the entries are in more than one currency (possible at EA, MCA or CSP billing scopes).