Azure / Azure/azure-cli

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

Open
#22,173 26 comments 2 reactions 2 assignees Assigned to @jiasli View on GitHub
Auto-Assign customer-reported needs-team-attention Policy Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

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](https://docs.microsoft.com/en-us/azure/governance/policy/how-to/get-compliance-data#query-for-resources) (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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.