POST https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}/alertIncidents/{alertIncidentId}/remediate?api-version=2022-08-01-preview
URI Parameters
Name
In
Required
Type
Description
alertId
path
True
string
The name of the alert to get.
alertIncidentId
path
True
string
The name of the alert incident to get.
scope
path
True
string
The fully qualified Azure Resource manager identifier of the resource.
api-version
query
True
string
minLength: 1
The API version to use for this operation.
Responses
Name
Type
Description
204 No Content
There is no content to send for this request, but the headers may be useful.
POST https://management.azure.com/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts/DuplicateRoleCreated/alertIncidents/0645231d-16ba-4ebf-851a-0875df4052bd/remediate?api-version=2022-08-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.authorization import AuthorizationManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-authorization
# USAGE
python remediate_alert_incident.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AuthorizationManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.alert_incidents.remediate(
scope="subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
alert_id="DuplicateRoleCreated",
alert_incident_id="0645231d-16ba-4ebf-851a-0875df4052bd",
)
# x-ms-original-file: 2022-08-01-preview/RemediateAlertIncident.json
if __name__ == "__main__":
main()