How to get the status of the Remediate State programaticaaly while creating policies (Python SDK)

Anitha Singamsetti 1 Reputation point

Actually we are trying to create the custom policies using Python SDK.
So we were able to create policy definition, policy assignment and also the policy remediation.
But, the remediation state is in the process of evaluating...We don't want to wait until
it completes. So, I am trying to find out the way like, how to get the status of the remediation state when it completes via python SDK...Can anyone please help me in this issue

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

2 answers

Sort by: Most helpful
  1. Jesse Loudon 336 Reputation points MVP

    hi @Anitha Singamsetti

    I can see there's 4 methods available via the Azure SDK for Python related to your need:

    • get_at_management_group - Gets an existing remediation at management group scope.
    • get_at_resource - Gets an existing remediation at resource scope.
    • get_at_resource_group - Gets an existing remediation at resource group scope.
    • get_at_subscription - Gets an existing remediation at subscription scope.

    more info from Microsoft Learn here

    for example;

    get_at_management_group(management_group_id: str, remediation_name: str, **kwargs) -> azure.mgmt.policyinsights.models._models_py3.Remediation  

    will return Remediation, or the result of cls(response)

    0 comments No comments

  2. Marwa Abouawad 281 Reputation points Microsoft Employee

    Hi @Anitha Singamsetti

    I am following up to check if you still need any further help.

    0 comments No comments