Skip to main content

recommendations

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

Overview

Namerecommendations
TypeResource
Idazure.advisor.recommendations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe resource ID.
namestringThe name of the resource.
actionsarrayThe list of recommended actions to implement recommendation.
categorystringThe category of the recommendation. Known values are: "HighAvailability", "Security", "Performance", "Cost", and "OperationalExcellence".
descriptionstringThe detailed description of recommendation.
exposedMetadataPropertiesobjectThe recommendation metadata properties exposed to customer to provide additional information.
extendedPropertiesobjectExtended properties.
impactstringThe business impact of the recommendation. Known values are: "High", "Medium", and "Low".
impactedFieldstringThe resource type identified by Advisor.
impactedValuestringThe resource identified by Advisor.
labelstringThe label of recommendation.
lastUpdatedstring (date-time)The most recent time that Advisor checked the validity of the recommendation.
learnMoreLinkstringThe link to learn more about recommendation and generation logic.
metadataobjectThe recommendation metadata.
potentialBenefitsstringThe potential benefit of implementing recommendation.
recommendationTypeIdstringThe recommendation-type GUID.
remediationobjectThe automated way to apply recommendation.
resourceMetadataobjectMetadata of resource that was assessed.
shortDescriptionobjectA summary of the recommendation.
suppressionIdsarrayThe list of snoozed and dismissed rules for the recommendation.
typestringThe type of the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_uri, recommendation_idObtains details of a cached recommendation.
listselectsubscription_id$filter, $top, $skipTokenObtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations.
get_generate_statusexecoperation_id, subscription_idRetrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response header.
generateexecsubscription_idInitiates the recommendation generation or computation process for a subscription. This operation is asynchronous. The generated recommendations are stored in a cache in the Advisor service.

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
operation_idstringThe operation ID, which can be found from the Location field in the generate recommendation response header. Required.
recommendation_idstringThe recommendation ID. Required.
resource_uristringThe fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies. Required.
subscription_idstring
$filterstringThe filter to apply to the recommendations.\ Filter can be applied to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '\ Category <#category>_\ '] with operators ['eq', 'and', 'or'].\ Example:\ - $filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup'. Default value is None.
$skipTokenstringThe page-continuation token to use with a paged version of this API. Default value is None.
$topintegerThe number of recommendations per page if a paged version of this API is being used. Default value is None.

SELECT examples

Obtains details of a cached recommendation.

SELECT
id,
name,
actions,
category,
description,
exposedMetadataProperties,
extendedProperties,
impact,
impactedField,
impactedValue,
label,
lastUpdated,
learnMoreLink,
metadata,
potentialBenefits,
recommendationTypeId,
remediation,
resourceMetadata,
shortDescription,
suppressionIds,
type
FROM azure.advisor.recommendations
WHERE resource_uri = '{{ resource_uri }}' -- required
AND recommendation_id = '{{ recommendation_id }}' -- required
;

Lifecycle Methods

Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response header.

EXEC azure.advisor.recommendations.get_generate_status 
@operation_id='{{ operation_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;