Skip to main content

benefit_recommendations

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

Overview​

Namebenefit_recommendations
TypeResource
Idazure.cost_management.benefit_recommendations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
allRecommendationDetailsobjectThe list of all benefit recommendations with the recommendation details.
armSkuNamestringARM SKU name. 'Compute_Savings_Plan' for SavingsPlan.
commitmentGranularitystringGrain of the proposed commitment amount. Supported values: 'Hourly'. Known values are: "Hourly", "Daily", and "Monthly". (Hourly, Daily, Monthly)
costWithoutBenefitnumberThe current cost without benefit, corresponds to 'totalHours' in the look-back period.
currencyCodestringAn ISO 4217 currency code identifier for the costs and savings amounts.
firstConsumptionDatestring (date-time)The first usage date used for looking back for computing the recommendations.
kindstringReservation or SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". (IncludedQuantity, Reservation, SavingsPlan)
lastConsumptionDatestring (date-time)The last usage date used for looking back for computing the recommendations.
lookBackPeriodstringThe number of days of usage evaluated for computing the recommendations. Known values are: "Last7Days", "Last30Days", and "Last60Days". (Last7Days, Last30Days, Last60Days)
recommendationDetailsobjectBenefit recommendation details.
scopestringBenefit scope. For example, Single or Shared. Required. Known values are: "Single" and "Shared".
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
termstringTerm period of the benefit. For example, P1Y or P3Y. Known values are: "P1Y" and "P3Y". (P1Y, P3Y)
totalHoursintegerThe total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
usageobjectOn-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectbilling_scope$filter, $orderby, $expandList of recommendations for purchasing savings plan.

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
billing_scopestringThe scope associated with benefit recommendation operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for enterprise agreement scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing profile scope. Required.
$expandstringMay be used to expand the properties by: properties/usage, properties/allRecommendationDetails. Default value is None.
$filterstringCan be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. Default value is None.
$orderbystringMay be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause. Default value is None.

SELECT examples​

List of recommendations for purchasing savings plan.

SELECT
id,
name,
allRecommendationDetails,
armSkuName,
commitmentGranularity,
costWithoutBenefit,
currencyCode,
firstConsumptionDate,
kind,
lastConsumptionDate,
lookBackPeriod,
recommendationDetails,
scope,
systemData,
term,
totalHours,
type,
usage
FROM azure.cost_management.benefit_recommendations
WHERE billing_scope = '{{ billing_scope }}' -- required
AND $filter = '{{ $filter }}'
AND $orderby = '{{ $orderby }}'
AND $expand = '{{ $expand }}'
;