Unsupported resource type: 'Microsoft.PolicyInsights/policyStates/queryResults'

See original GitHub issue

Good day! On the way to look for noncompliant resources I executed ‘az policy state list --all’ which ended up in an error see below. I get the same error when I execute ‘az rest’ with the uri described here Azure Doc (of course with adjusted values, e.g. subscription id)

Describe the bug

Command Name az policy state list

Errors:

(ResourceTypeNotSupported) Unsupported resource type: 'Microsoft.PolicyInsights/policyStates/queryResults'.
Code: ResourceTypeNotSupported
Message: Unsupported resource type: 'Microsoft.PolicyInsights/policyStates/queryResults'.

To Reproduce:

  • az policy state list --all

Expected Behavior

  • successful output of result in json (as always)

Environment Summary

macOS-12.3.1-x86_64-i386-64bit, Darwin 21.4.0
Python 3.10.2
Installer: HOMEBREW

azure-cli 2.35.0

Extensions:
front-door 1.0.16
alertsmanagement 0.2.2
logic 0.1.5
resource-graph 2.1.0
sentinel 0.1.2
ssh 1.1.0
application-insights 0.1.14

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
HansZimmer5000commented, Nov 27, 2022

@zhoxing-ms az policy state list --all works for me now, no problems / warnings. Have az in version 2.42.0.

I didn’t check the Rest API yet. Might do it tomorrow, but don’t rely on it.

1reaction
zhoxing-mscommented, Apr 28, 2022

This issue seems to be a service issue:

Request URL:

GET /subscriptions/{subscription}/providers/Microsoft.PolicyInsights/policyStates/default/queryResults?api-version=2019-10-01&$skipToken=xxx HTTP/1.1

Response:

{"error":{"code":"ResourceTypeNotSupported","message":"Unsupported resource type: 'Microsoft.PolicyInsights/policyStates/queryResults'."}}

This issue needs the service team to investigate the root cause of this error message

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get policy compliance data - Azure - Microsoft Learn
Compliance results can be exported from the Portal through Azure Resource Graph queries. Command line. The same information available in the ...
Read more >
Policy States - Summarize For Resource Group - Microsoft Learn
The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is...
Read more >
Azure Resource Graph table and resource type reference
Provide a list of the Azure Resource Manager resource types supported by Azure Resource Graph and Change History.
Read more >
Policy States - List Query Results For Resource - Microsoft Learn
POST https://management.azure.com/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults?api-version=2019-10-01.
Read more >
Troubleshoot common errors - Azure Policy - Microsoft Learn
The mode should be all for all resource types. ... to finish and compliance results to become available in the Azure portal or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found