Azure PowerShell Reference

Module: Az.Advisor

Az.Advisor Module

The Az.Advisor module provides access to Azure Advisor, a service that analyzes your Azure resource configuration and offers recommendations to help you optimize your deployments for performance, security, cost, and high availability.

Available Commands

Get-AzAdvisorRecommendation

Retrieves recommendations from Azure Advisor.

Syntax

Get-AzAdvisorRecommendation
   [-Scope <String>]
   [-Filter <String>]
   [-ODataQuery <String>]
   [-DefaultProfile <IAzureContextContainer>]

Parameters

Name Description Type
-Scope Specifies the scope of the query. Valid values are "ResourceGroup", "Subscription". String
-Filter OData filter string. String
-ODataQuery OData query string. String
-DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. IAzureContextContainer

Examples

# Get all recommendations for the current subscription
Get-AzAdvisorRecommendation

# Get recommendations for a specific resource group
Get-AzAdvisorRecommendation -Scope "ResourceGroup" -Filter "contains(tags, 'environment') and tagValue eq 'production'"

Get-AzAdvisorConfiguration

Retrieves the configuration settings for Azure Advisor.

Syntax

Get-AzAdvisorConfiguration
   [-DefaultProfile <IAzureContextContainer>]

Parameters

Name Description Type
-DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. IAzureContextContainer

Examples

# Get the Azure Advisor configuration
Get-AzAdvisorConfiguration

Set-AzAdvisorConfiguration

Updates the configuration settings for Azure Advisor.

Syntax

Set-AzAdvisorConfiguration
   [-Exclude <String[]>]
   [-DefaultProfile <IAzureContextContainer>]

Parameters

Name Description Type
-Exclude Specifies an array of recommendation types to exclude. String[]
-DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. IAzureContextContainer

Examples

# Exclude "HighAvailability" and "Cost" recommendations
Set-AzAdvisorConfiguration -Exclude "HighAvailability", "Cost"

# Remove all exclusions
Set-AzAdvisorConfiguration -Exclude @()

Notes

  • This module requires Azure PowerShell to be installed and configured.
  • Ensure you are logged in to your Azure account using Connect-AzAccount.
  • Refer to the official Azure documentation for a complete list of recommendation types and their descriptions.