I am using this api url for getting virtual machine compliance status, however its giving me 202 Accepted response.
I have attached image for reference, I wanted to get these information through api.

I am using this api url for getting virtual machine compliance status, however its giving me 202 Accepted response.
I have attached image for reference, I wanted to get these information through api.

I tried to reproduce the same in my environment and got below results:
I created one Azure AD application named
WebAppand granted API permission like below:I generated access token via Postman with below parameters:
Response:
Using above token, I too got same response like
202 Acceptedwhile running the same query as you like below:Response:
Currently, there is no such
REST APIquery that can fetch you all virtual machine's compliance status. To confirm that, you can check this. Alternatively, you can make use of Kusto query.I have below information on virtual machine's compliance status in my automation account:
To get this information from Kusto query, you need to follow below steps:
Go to Azure Portal -> Automation Accounts -> Select account -> Logs -> Azure Update Management -> Computers list -> Run
When I ran the query with scope as subscription, I got the results successfully like below:
Reference:
Retrieve azure update management status using REST API by VenkateshDodda-MSFT