Programmatically trigger Azure policy remediation

MrFlinstone 541 Reputation points
2024-09-09T22:14:57.2533333+00:00

I have got azure policy auto remediation in place, however the process is a manual one where the remediation tasks needs to be manually triggered. I was wondering if there is a way to programmatically trigger the running of the remediation job.

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
872 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 23,160 Reputation points MVP
    2024-09-09T23:39:41.5133333+00:00

    Yes - there is. Refer to

    https://video2.skills-academy.com/en-us/powershell/module/az.policyinsights/start-azpolicyremediation?view=azps-12.3.0

    https://video2.skills-academy.com/en-us/rest/api/policy/remediations?view=rest-policy-2021-10-01


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.