Get-AzAdvisorRecommendation

Obtains details of a cached recommendation.

Syntax

Get-AzAdvisorRecommendation
   [-SubscriptionId <String[]>]
   [-Filter <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzAdvisorRecommendation
   [-SubscriptionId <String[]>]
   [-Category <String>]
   -ResourceId <String>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzAdvisorRecommendation
   [-SubscriptionId <String[]>]
   -ResourceGroupName <String>
   [-Category <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzAdvisorRecommendation
   -Id <String>
   -ResourceUri <String>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzAdvisorRecommendation
   -InputObject <IAdvisorIdentity>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]

Description

Obtains details of a cached recommendation.

Examples

Example 1: List Recommendation by subscriptionId and resource group name

Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability

Name                                 Category         Resource Group Impact ImpactedValue ImpactedField
----                                 --------         -------------- ------ ------------- -------------
71411b72-e7de-9dc2-308b-5c60252e1456 HighAvailability lnxtest        Medium lnxtest-vnet  MICROSOFT.NETWORK/VIRTUALNETWORKS
bf8ebdfd-6caa-9f55-53ae-ffafefbf3a7c HighAvailability lnxtest        Medium advisortest   MICROSOFT.NETWORK/VIRTUALNETWORKS
339071fa-d66a-be4f-9cf8-22b67552b287 HighAvailability lnxtest        Medium advisor-test  MICROSOFT.NETWORK/VIRTUALNETWORKS

List Recommendation by subscriptionId

Example 2: List Recommendation by subscriptionId and filter

Get-AzAdvisorRecommendation -filter "Category eq 'HighAvailability' and ResourceGroup eq 'lnxtest'"

Name                                 Category         Resource Group Impact ImpactedValue ImpactedField
----                                 --------         -------------- ------ ------------- -------------
71411b72-e7de-9dc2-308b-5c60252e1456 HighAvailability lnxtest        Medium lnxtest-vnet  MICROSOFT.NETWORK/VIRTUALNETWORKS
bf8ebdfd-6caa-9f55-53ae-ffafefbf3a7c HighAvailability lnxtest        Medium advisortest   MICROSOFT.NETWORK/VIRTUALNETWORKS
339071fa-d66a-be4f-9cf8-22b67552b287 HighAvailability lnxtest        Medium advisor-test  MICROSOFT.NETWORK/VIRTUALNETWORKS

List Recommendation by subscriptionId and filter

Example 3: Get Recommendation by Id and resource Id

Get-AzAdvisorRecommendation -Id 42963553-61de-5334-2d2e-47f3a0099d41 -ResourceUri /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f

Name                                 Category Resource Group   Impact ImpactedValue    ImpactedField
----                                 -------- --------------   ------ -------------    -------------
42963553-61de-5334-2d2e-47f3a0099d41 Security automanagehcrprg High   arcbox-capi-mgmt Microsoft.Compute/virtualMachines

Get Recommendation by Id and resource Id

Parameters

-Category

The category of recommendation.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

The 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'
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

The recommendation ID.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IAdvisorIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

The resource group name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The resource Id.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceUri

The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The Azure subscription ID.

Type:String[]
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IAdvisorIdentity

Outputs

IResourceRecommendationBase