Azure Advisor API: Export Recommendations With REST and ARG Azure Advisor analyzes your configuration and usage telemetry and flags ways to improve cost, performance, security, reliability, and operational excellence. Clicking through the portal works for one subscription. It stops working at 40.

Two programmatic paths solve this. The Advisor REST API gives you direct, subscription-scoped access to recommendation resources. Azure Resource Graph (ARG) lets you query recommendation data with KQL across the subscriptions or management groups you can access.

This guide walks through a four-stage workflow: set scope and identity, export with REST, query with ARG, then normalize the output. It also covers the filtering, pagination, authentication, and freshness mistakes that produce silently incomplete exports.

Four-stage Azure Advisor recommendation export workflow

Key Takeaways

  • REST exports give direct API responses with precise request control for ticketing integrations.
  • ARG exports enable cross-scope querying and KQL-based reporting.
  • Complete exports need correct Entra ID tokens, RBAC, scope, and pagination handling.
  • Treat recommendations as decision-support data, not automatic remediation orders.

How to Export Azure Advisor Recommendations Using REST and ARG

Keep four stages separate: access preparation, retrieval, filtering, and normalization. That separation stops a partial export from passing as a complete inventory.

Step 1: Establish the Azure scope, identity, and output requirements

Decide what the export covers: one subscription, several subscriptions, a management group, or a broader reporting process. Then pick the output: JSON, CSV, a dashboard feed, or a ticketing payload.

Before writing any request, confirm:

  • Subscription IDs, tenant context, and resource groups if relevant
  • The identity making the call (user, service principal, or managed identity)
  • The fields and categories the downstream team needs

The scope models differ:

  • REST Advisor List takes a subscription ID in the path. Management group and tenant are not scope parameters of that operation.
  • ARG accepts an explicit subscription list or management group IDs (not display names). You cannot combine the two in one query.

Step 2: Export recommendations with the Azure Advisor REST API

The current stable endpoint, per Microsoft's REST reference, is:

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations?api-version=2026-10-01
Authorization: Bearer <access-token>

The request is a bodyless GET. Request a token for the Azure Resource Manager audience, https://management.azure.com/.

Scope syntax varies by library. MSAL.NET managed-identity docs use https://management.azure.com/.default. Identity-platform guidance notes https://management.azure.com//.default for ARM's trailing-slash resource URI. Check which applies to your client.

Build the $filter

Supported filter properties are ResourceId, ResourceGroup, RecommendationTypeGuid, Category, SubCategory, RetirementDate, and RecommendationStatus. Operators include eq, and, or, lt, gt, le, and ge.

$filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup'
$filter=trackingIds/any(t: t eq 'VN1S-1V8')

Use single quotes and URL-encode the full query string. Status filtering starts at 2026-02-01-preview, so confirm it against your pinned version.

Read the response and paginate

A 200 OK returns a value array of recommendation resources. If nextLink is present, follow it until it disappears. $top sets page size and $skipToken carries continuation. Log the request scope and timestamp for every page.

Azure Advisor REST API pagination and recommendation response flow

Useful properties include category, impact (High, Medium, Low), impactedField, impactedValue, lastUpdated, recommendationTypeId, and resourceMetadata.

Step 3: Query recommendations with Azure Resource Graph

Advisor data lives in the advisorresources table with type microsoft.advisor/recommendations. Microsoft's sample uses =~ for case-insensitive type matching; == is case-sensitive. Here is an adapted official sample that summarizes monthly cost savings:

AdvisorResources
| where type =~ 'microsoft.advisor/recommendations'
| where properties.category == 'Cost'
| extend resources = tostring(properties.resourceMetadata.resourceId),
    savings = todouble(properties.extendedProperties.savingsAmount),
    solution = tostring(properties.shortDescription.solution),
    currency = tostring(properties.extendedProperties.savingsCurrency)
| summarize dcount(resources), bin(sum(savings), 0.01) by solution, currency
| order by sum_savings desc

For a flat export, project id, category, impact, affected resource, recommendation type, and lastUpdated instead.

Limits, freshness, and scope

  • Page size: default and maximum are 1,000 records. Pass the returned $skipToken into the next query's options.
  • No token: queries using limit, take, or sample return no $skipToken.
  • Stable ordering: include the unique id in sorting, or pages can duplicate or skip rows.
  • Quota: ARG throttles per user. Watch x-ms-user-quota-remaining and wait for reset at zero.
  • Freshness: ARG isn't strongly consistent, and no Advisor-specific latency is documented.
  • Visibility: results depend on your permissions. Mixed access gives partial results, and no accessible subscriptions can produce a 403.

Azure Resource Graph export limits freshness and access considerations

An empty or short result does not prove there are no recommendations.

Step 4: Normalize, validate, and export the results

Flatten nested REST objects and dynamic ARG properties into one schema. Cast explicitly with tostring and todouble. Watch for nulls: tostring turns them into empty strings and can hide missing data.

Add these columns to every row:

  • Source (REST or ARG)
  • Retrieval timestamp
  • Subscription ID and resource ID
  • Status or remediation owner, when available

Then validate:

  • Compare record counts between methods
  • Check for duplicates
  • Confirm pagination finished
  • Keep the raw payloads

ARG Explorer's CSV download caps at 55,000 records, so scripted exports suit larger estates.

When Should You Use REST or ARG, and What Do You Need First?

The right method depends on scope, API control, reporting frequency, and whether a person or a pipeline consumes the output.

When REST or ARG is the better fit

Choose REST when you need:

  • Subscription-scoped retrieval
  • Application integrations
  • Precise API filtering
  • Workflows that create remediation tickets

Choose ARG when you need:

  • Centralized inventory
  • KQL filtering
  • Cross-subscription reporting
  • Joining Advisor data with other resource metadata

What you need before exporting

  • An Entra ID user, service principal, or managed identity
  • Reader at subscription, resource group, or resource scope (the Microsoft.Advisor/recommendations/read action)
  • Access to the underlying resource
  • Resource-read access for ARG queries
  • A secure place for tokens and exported data

Key Parameters That Affect Azure Advisor Export Results

Scope and subscription selection

A subscription-level REST call doesn't represent the whole estate, and ARG may see a different set of subscriptions. Mismatched scope is the top cause of REST and ARG disagreeing.

API version and data schema

Fields and filter support change by version. Stable 2026-10-01 separates lastRefreshed (last validity check) from lastUpdated (last state change). Pin the version, store raw payloads, and write parsers that tolerate optional fields.

Azure Advisor API version schema fields and parser safeguards

Filter and query construction

REST $filter and KQL follow different rules for names, operators, quoting, and casing. A common trap: responses return recommendationTypeId, but the filter field is RecommendationTypeGuid. Test unfiltered first, then narrow.

Pagination, freshness, and throttling

Advisor List reads cached results, so timing affects what you export:

  • New resources can take up to 24 hours to get recommendations
  • Implemented fixes can take up to a day to clear

Throttling is separate from freshness. Per Microsoft's throttling guidance, ARM returns Retry-After on a 429, and earlier retries restart the clock. Current limits use a token bucket (250 with 25/sec refill) per subscription and tenant.

Azure Advisor throttling token bucket and retry behavior

Common Mistakes and Troubleshooting Azure Advisor Exports

Invalid $filter or empty filtered results

  • Likely cause: unsupported property, wrong casing, unencoded $ or spaces, double quotes, or syntax from another Azure API.
  • Fix: compare against current docs, run the unfiltered request, encode the full string, and confirm real category and impact values.

Missing recommendations or incomplete coverage

  • Likely cause: missing read access, wrong subscription, ARG seeing fewer subscriptions, or ignored nextLink.
  • Fix: test each scope alone, verify RBAC and tenant, inspect pagination, and compare with the portal.

401, 403, and throttling

  • Likely cause: wrong token audience, expired token, missing role, wrong account, or excess request rate.
  • Fix: request a management-plane token for the right tenant, confirm roles, honor Retry-After, back off exponentially, and never log secrets.

ARG errors and REST/ARG mismatches

  • Likely cause: outdated schema paths, uncast dynamic fields, runs at different times, or joins without stable IDs.
  • Fix: recheck the schema, cast explicitly, compare timestamps, join on recommendation and resource IDs, and keep raw output.

Alternatives to REST and ARG

Azure portal CSV or PDF export

Good for a one-time, human-readable report. It honors your filters but isn't repeatable, and it isn't an unrestricted estate export.

Azure CLI or Azure PowerShell

az advisor recommendation list supports --category, --ids, --resource-group, and --refresh. Its documented categories omit OperationalExcellence. Get-AzAdvisorRecommendation has a narrower filter than current REST. Both suit script-driven admins who don't want a custom client.

A broader storage optimization platform

Advisor exports tell you what Azure flags. If your team also needs multi-cloud block storage visibility and autonomous optimization, Lucidity is worth evaluating.

  • AutoScaler right-sizes disks
  • Lumen provides storage recommendations
  • Free assessment analyzes storage waste across AWS, Azure, and Google Cloud

A separate platform brings its own integration and governance review, so verify how it fits your workflow before assuming it connects to Advisor or ARG.

Conclusion

Reliable Advisor exports start with defined scope, identity, query syntax, schema, and pagination. REST suits direct integrations. ARG suits query-driven inventory. Either way, validate ownership and business impact before remediating.

Preserve raw responses, record retrieval context, handle access and continuation errors, and route each recommendation to an owner.

Frequently Asked Questions

What is the Azure Advisor API?

It's the Microsoft.Advisor management API for retrieving cached recommendations and triggering asynchronous generation. Data covers cost, performance, security, reliability, and operational excellence.

How do I export Azure Advisor recommendations with the REST API?

Get an ARM bearer token, send a GET to the subscription's Advisor recommendations endpoint with api-version=2026-10-01, and add an optional $filter. Read the value array and follow nextLink.

Can Azure Resource Graph query Azure Advisor recommendations?

Yes. Query the advisorresources table with KQL, filtering on microsoft.advisor/recommendations. Check the current schema, and remember ARG data is eventually consistent.

What permissions are needed to export Azure Advisor recommendations?

Entra ID authentication plus Reader (or higher) at the target scope and access to the underlying resource. ARG respects resource-read permissions and returns only what you can see.

Why is my Azure Advisor $filter returning an invalid filter error?

Usual causes are unsupported fields, wrong casing, malformed operators, missing URL encoding, or double quotes. Use RecommendationTypeGuid, not recommendationTypeId, and verify against current documentation.

What is the difference between REST and ARG for Azure Advisor exports?

REST gives direct, subscription-scoped API control for integrations. ARG gives KQL querying, aggregation, and cross-subscription reporting, with its own limits and freshness behavior.