benefit_recommendations
Creates, updates, deletes, gets or lists a benefit_recommendations resource.
Overview
| Name | benefit_recommendations |
| Type | Resource |
| Id | azure.cost_management.benefit_recommendations |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allRecommendationDetails | object | The list of all benefit recommendations with the recommendation details. |
armSkuName | string | ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan. |
commitmentGranularity | string | Grain of the proposed commitment amount. Supported values: 'Hourly'. Known values are: "Hourly", "Daily", and "Monthly". (Hourly, Daily, Monthly) |
costWithoutBenefit | number | The current cost without benefit, corresponds to 'totalHours' in the look-back period. |
currencyCode | string | An ISO 4217 currency code identifier for the costs and savings amounts. |
firstConsumptionDate | string (date-time) | The first usage date used for looking back for computing the recommendations. |
kind | string | Reservation or SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". (IncludedQuantity, Reservation, SavingsPlan) |
lastConsumptionDate | string (date-time) | The last usage date used for looking back for computing the recommendations. |
lookBackPeriod | string | The number of days of usage evaluated for computing the recommendations. Known values are: "Last7Days", "Last30Days", and "Last60Days". (Last7Days, Last30Days, Last60Days) |
recommendationDetails | object | Benefit recommendation details. |
scope | string | Benefit scope. For example, Single or Shared. Required. Known values are: "Single" and "Shared". |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Term period of the benefit. For example, P1Y or P3Y. Known values are: "P1Y" and "P3Y". (P1Y, P3Y) |
totalHours | integer | The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
usage | object | On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | billing_scope | $filter, $orderby, $expand | List 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.
| Name | Datatype | Description |
|---|---|---|
billing_scope | string | The 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. |
$expand | string | May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. Default value is None. |
$filter | string | Can 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. |
$orderby | string | May 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
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 }}'
;