Remediations - Create Or Update At Subscription

Creates or updates a remediation at subscription scope.

PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}?api-version=2018-07-01-preview

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Microsoft Azure subscription ID.

remediationName
path True
  • string

The name of the remediation.

api-version
query True
  • string

Client Api Version.

Request Body

Name Type Description
properties.deploymentStatus

The deployment status summary for all deployments created by the remediation.

properties.filters

The filters that will be applied to determine which resources to remediate.

properties.policyAssignmentId
  • string

The resource ID of the policy assignment that should be remediated.

properties.policyDefinitionReferenceId
  • string

The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

Responses

Name Type Description
200 OK

The updated remediation.

201 Created

The created remediation.

Other Status Codes

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create remediation at subscription scope
Create remediation at subscription scope with all properties

Create remediation at subscription scope

Sample Request

PUT https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/Microsoft.PolicyInsights/remediations/storageRemediation?api-version=2018-07-01-preview
{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"
  }
}

Sample Response

{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    "provisioningState": "Accepted",
    "createdOn": "2018-09-12T20:58:58.7531298Z",
    "lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
    "deploymentStatus": {
      "totalDeployments": 2,
      "successfulDeployments": 0,
      "failedDeployments": 0
    }
  },
  "id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
  "name": "storageRemediation",
  "type": "Microsoft.PolicyInsights/remediations"
}
{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    "provisioningState": "Accepted",
    "createdOn": "2018-09-12T20:58:58.7531298Z",
    "lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
    "deploymentStatus": {
      "totalDeployments": 2,
      "successfulDeployments": 0,
      "failedDeployments": 0
    }
  },
  "id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
  "name": "storageRemediation",
  "type": "Microsoft.PolicyInsights/remediations"
}

Create remediation at subscription scope with all properties

Sample Request

PUT https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/Microsoft.PolicyInsights/remediations/storageRemediation?api-version=2018-07-01-preview
{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    "policyDefinitionReferenceId": "8c8fa9e4",
    "filters": {
      "locations": [
        "eastus",
        "westus"
      ]
    }
  }
}

Sample Response

{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    "policyDefinitionReferenceId": "8c8fa9e4",
    "provisioningState": "Accepted",
    "createdOn": "2018-09-12T20:58:58.7531298Z",
    "lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
    "deploymentStatus": {
      "totalDeployments": 2,
      "successfulDeployments": 0,
      "failedDeployments": 0
    }
  },
  "id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
  "name": "storageRemediation",
  "type": "Microsoft.PolicyInsights/remediations"
}
{
  "properties": {
    "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    "policyDefinitionReferenceId": "8c8fa9e4",
    "provisioningState": "Accepted",
    "createdOn": "2018-09-12T20:58:58.7531298Z",
    "lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
    "deploymentStatus": {
      "totalDeployments": 2,
      "successfulDeployments": 0,
      "failedDeployments": 0
    }
  },
  "id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
  "name": "storageRemediation",
  "type": "Microsoft.PolicyInsights/remediations"
}

Definitions

ErrorDefinition

Error definition.

ErrorResponse

Error response.

Remediation

The remediation definition.

RemediationDeploymentSummary

The deployment status summary for all deployments created by the remediation.

RemediationFilters

The filters that will be applied to determine which resources to remediate.

TypedErrorInfo

Scenario specific error details.

ErrorDefinition

Error definition.

Name Type Description
additionalInfo

Additional scenario specific error details.

code
  • string

Service specific error code which serves as the substatus for the HTTP error code.

details

Internal error details.

message
  • string

Description of the error.

target
  • string

The target of the error.

ErrorResponse

Error response.

Name Type Description
error

The error details.

Remediation

The remediation definition.

Name Type Description
id
  • string

The ID of the remediation.

name
  • string

The name of the remediation.

properties.createdOn
  • string

The time at which the remediation was created.

properties.deploymentStatus

The deployment status summary for all deployments created by the remediation.

properties.filters

The filters that will be applied to determine which resources to remediate.

properties.lastUpdatedOn
  • string

The time at which the remediation was last updated.

properties.policyAssignmentId
  • string

The resource ID of the policy assignment that should be remediated.

properties.policyDefinitionReferenceId
  • string

The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

properties.provisioningState
  • string

The status of the remediation.

type
  • string

The type of the remediation.

RemediationDeploymentSummary

The deployment status summary for all deployments created by the remediation.

Name Type Description
failedDeployments
  • integer

The number of deployments required by the remediation that have failed.

successfulDeployments
  • integer

The number of deployments required by the remediation that have succeeded.

totalDeployments
  • integer

The number of deployments required by the remediation.

RemediationFilters

The filters that will be applied to determine which resources to remediate.

Name Type Description
locations
  • string[]

The resource locations that will be remediated.

TypedErrorInfo

Scenario specific error details.

Name Type Description
info

The scenario specific error details.

type
  • string

The type of included error details.