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:

OK. Successfully got recommendation detail.

NameDatatypeDescription
idstring (arm-id)Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
namestringThe name of the resource
propertiesobjectThe properties of the recommendation.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceUri, recommendationIdObtains details of a cached recommendation.
listselectsubscriptionId$filter, $top, $skipTokenObtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations.
generateexecsubscriptionIdInitiates 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.
exec_get_generate_statusexecsubscriptionId, operationIdRetrieves 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.
predictexecsubscriptionId

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
operationIdstring (uuid)The operation ID, which can be found from the Location field in the generate recommendation response header.
recommendationIdstringThe recommendation ID.
resourceUristringThe fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.
subscriptionIdstringThe Azure subscription ID.
$filterstringThe filter to apply to the recommendations.
Filter can be applied to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', 'Category'] with operators ['eq', 'and', 'or'].
Example:
- $filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup'
$skipTokenstringThe page-continuation token to use with a paged version of this API.
$topinteger (int32)The number of recommendations per page if a paged version of this API is being used.

SELECT examples

Obtains details of a cached recommendation.

SELECT
id,
name,
properties,
systemData,
type
FROM azure.advisor.recommendations
WHERE resourceUri = '{{ resourceUri }}' -- required
AND recommendationId = '{{ recommendationId }}' -- required
;

Lifecycle Methods

Initiates 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.

EXEC azure.advisor.recommendations.generate 
@subscriptionId='{{ subscriptionId }}' --required
;