How frequently the policy gets evaluated? can we change that frequency? or trigger it manually somehow? Its taking huge effort to test authored policies and assignments and results are not consistent, dev, test and fix cycles are taking long time
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@badalk Thanks for the Comment. We are actively investigating and will get back to you soon.
@badalk Thanks for the question! Details about when policy is evaluated is documented here. Triggering evaluation is now possible, but the doc hasn't yet been published. I'm working on it and hope to have it ready shortly. I'll update this Issue when it is published. Thanks!
@MicrosoftDocs/azure-cxp-triage Please assign to me, add label 'doc-enhancement', and #in-progress.
@DCtheGeek Any Update on documentation of How to trigger evaluation manually?
Please share details about manual triggers since it would really help while testing custom policy definitions.
@diwsun I apologize for the delay. I'll have it posted by mid-week!
@badalk @devanshujoshi @diwsun This content went live yesterday! Give it a look and let me know if there are questions: On demand evaluation scan. If there are issues, let me know and I'll enhance. Otherwise, I'm going to close this Issue now. Thanks for both the feedback and the patience.
@MicrosoftDocs/azure-cxp-triage #please-close
@DCtheGeek I appreciate the write up but I feel it is failing on results. When attempting a triggered Eval via the POST to the subscription, using the PS provided to generate the Bearer token, the response is blank using the trigEval uri... When attempting to use the token generated in ARC, I get a 401 even tho I am owner of the subscription in question. What am I missing?
@ms662412 Not sure which "PS provided to generate the Bearer token" you are talking about. I'd recommend trying the POST through ARMClient which does login for you. If that also doesn't work, please open as a new Issue so we can try and address. If it's a problem with the instructions, however, then I'd like to figure that out so we can clear up any confusion or inaccuracies. Otherwise, it may end up being a support case since that kind of troubleshooting starts to fall outside of docs.
Is not this do what is being asked without complexity of manually invoking it via POST method?
Invoke-AzureRmResourceAction -ResourceType Microsoft.PolicyInsights/policyStates -Action triggerEvaluation -ResourceName latest -ApiVersion 2018-07-01-preview
@DCtheGeek Is this feature still active?
I'm using the JWT token from the Try out section as Authorization header in my request to make sure auth is working.
However, whatever I try to do, the best I can get is:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code: 501</p>
<p>Message: Not Implemented.</p>
<p>Error code explanation: 501 - Server does not support this operation.</p>
</body>
</html>
@timgrossmann I just tried via ARMClient and it worked fine. I'd recommend validating with ARMClient. If that doesn't work, please open a support ticket so the team can help as it doesn't appear to be an issue with the doc. Thanks!
@DCtheGeek Thank you for checking it.
I'll double check with the ARM client and see if it works using that instead of the REST API.
Thanks