I am following up to check if you still need any further help.
How to get the status of the Remediate State programaticaaly while creating policies (Python SDK)
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
2 answers
Sort by: Newest
-
Marwa Abouawad 281 Reputation points Microsoft Employee
2022-10-10T14:35:15.717+00:00 -
Jesse Loudon 336 Reputation points MVP
2022-02-07T00:30:42.11+00:00 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 https://learn.microsoft.com/en-us/python/api/azure-mgmt-policyinsights/azure.mgmt.policyinsights.aio.operations.remediationsoperations?view=azure-python
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) https://learn.microsoft.com/en-us/python/api/azure-mgmt-policyinsights/azure.mgmt.policyinsights.models.remediation?view=azure-python