LinuxCommandLibrary

az-advisor

Get Azure best practice recommendations

TLDR

List Azure Advisor configuration for the entire subscription

$ az advisor configuration list
copy

Show Azure Advisor configuration for the given subscription or resource group
$ az advisor configuration show [[-g|--resource-group]] [resource_group]
copy

List Azure Advisor recommendations
$ az advisor recommendation list
copy

Enable Azure Advisor recommendations
$ az advisor recommendation enable [[-g|--resource-group]] [resource_group]
copy

Disable Azure Advisor recommendations
$ az advisor recommendation disable [[-g|--resource-group]] [resource_group]
copy

SYNOPSIS

az advisor <subcommand> [--resource-group -g] [--subscription -s] [options]

PARAMETERS

--category
    Filter by category: Cost, Security, Performance, Reliability, Excellence.

--ids
    Space-separated recommendation or advisor IDs.

--refresh
    Trigger server-side refresh of recommendations.

--resource-group, -g
    Limit to specific resource group.

--subscription, -s
    Subscription ID or name.

--top
    Return only top N recommendations.

--advisor-id
    Specific Advisor resource ID for show/update.

--configuration-name
    Name of the configuration to manage.

--scope
    Scope for configurations (e.g., /subscriptions/{sub}).

--state
    Update recommendation state: Dismissed, Postponed.

--reason
    Reason code for state update.

--reason-meta-data
    Metadata for the update reason.

DESCRIPTION

az advisor is a command group within the Azure CLI for managing Azure Advisor recommendations, a free service offering personalized best practices to optimize Azure resources across Cost, Security, Performance, Reliability, and Operational Excellence categories.

It enables listing recommendations scoped to subscriptions or resource groups, viewing details, updating states (e.g., Dismiss, Postpone), configuring recommendation suppression per scope, and retrieving metadata.

Ideal for scripting, automation, and DevOps workflows, it integrates with Azure CLI's output formats like table, JSON, or TSV. Use cases include proactive cost savings, security hardening, and performance tuning without portal access.

Requires az login with Reader or higher permissions on target scopes. Supports filtering by category or ID for targeted analysis.

CAVEATS

Requires Azure CLI ≥2.15.0; Contributor role for updates/configs. High-volume lists may throttle; use --top or filters. Not all recommendations refresh instantly.

KEY SUBCOMMANDS

recommendation list - List recommendations.
recommendation show - View details.
recommendation update - Change state.
configuration {list|create|delete} - Manage suppressions.

EXAMPLE USAGE

az advisor recommendation list --category Cost --subscription <sub-id>
az advisor recommendation update --ids <id> --state Dismissed

HISTORY

Introduced in Azure CLI 2.2.0 (2018) with basic list/show; expanded in 2.10+ for configurations/metadata; full categories support by 2.20.0 (2021).

SEE ALSO

az security(1), az consumption(1), az monitor(1)

Copied to clipboard