Security Policies - Patch

Updates an existing security policy within a profile.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}?api-version=2023-05-01

URI Parameters

Name In Required Type Description
profileName
path True

string

Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.

resourceGroupName
path True

string

Name of the Resource group within the Azure subscription.

Regex pattern: ^[-\w\._\(\)]+$

securityPolicyName
path True

string

Name of the security policy under the profile.

subscriptionId
path True

string

Azure Subscription ID.

api-version
query True

string

Version of the API to be used with the client request. Current version is 2023-05-01.

Request Body

Name Type Description
properties.parameters SecurityPolicyPropertiesParameters:

SecurityPolicyWebApplicationFirewallParameters

object which contains security policy parameters

Responses

Name Type Description
200 OK

SecurityPolicy

OK

202 Accepted

SecurityPolicy

Accepted. The request has been accepted for processing and the operation will complete asynchronously.

Headers

location: string

Other Status Codes

AfdErrorResponse

Azure Front Door 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

SecurityPolicies_Patch

Sample Request

PATCH https://management.azure.com/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/securityPolicies/securityPolicy1?api-version=2023-05-01

{
  "properties": {
    "parameters": {
      "type": "WebApplicationFirewall",
      "wafPolicy": {
        "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"
      },
      "associations": [
        {
          "domains": [
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"
            },
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"
            }
          ],
          "patternsToMatch": [
            "/*"
          ]
        }
      ]
    }
  }
}

Sample Response

{
  "name": "securityPolicy1",
  "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1",
  "type": "Microsoft.Cdn/profiles/securitypolicies",
  "properties": {
    "parameters": {
      "type": "WebApplicationFirewall",
      "wafPolicy": {
        "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"
      },
      "associations": [
        {
          "domains": [
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"
            },
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"
            }
          ],
          "patternsToMatch": [
            "/*"
          ]
        }
      ]
    },
    "deploymentStatus": "NotStarted",
    "provisioningState": "Succeeded"
  }
}
azure-asyncoperation: https://management.azure.com/subscriptions/subid/resourcegroups/resourceGroupName/providers/Microsoft.Cdn/operationresults/operationId?api-version=2023-05-01
{
  "name": "securityPolicy1",
  "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1",
  "type": "Microsoft.Cdn/profiles/securitypolicies",
  "properties": {
    "parameters": {
      "type": "WebApplicationFirewall",
      "wafPolicy": {
        "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"
      },
      "associations": [
        {
          "domains": [
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"
            },
            {
              "id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"
            }
          ],
          "patternsToMatch": [
            "/*"
          ]
        }
      ]
    },
    "deploymentStatus": "NotStarted",
    "provisioningState": "Updating"
  }
}

Definitions

Name Description
ActivatedResourceReference

Reference to another resource along with its state.

AfdErrorResponse

Error response

AfdProvisioningState

Provisioning status

DeploymentStatus
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

IdentityType

The type of identity that creates/modifies resources

ResourceReference

Reference to another resource.

SecurityPolicy

SecurityPolicy association for AzureFrontDoor profile

SecurityPolicyUpdateParameters

The JSON object containing security policy update parameters.

SecurityPolicyWebApplicationFirewallAssociation

settings for security policy patterns to match

SecurityPolicyWebApplicationFirewallParameters

The json object containing security policy waf parameters

SystemData

Read only system data

ActivatedResourceReference

Reference to another resource along with its state.

Name Type Description
id

string

Resource ID.

isActive

boolean

Whether the resource is active or inactive

AfdErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

AfdProvisioningState

Provisioning status

Name Type Description
Creating

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

DeploymentStatus

Name Type Description
Failed

string

InProgress

string

NotStarted

string

Succeeded

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

IdentityType

The type of identity that creates/modifies resources

Name Type Description
application

string

key

string

managedIdentity

string

user

string

ResourceReference

Reference to another resource.

Name Type Description
id

string

Resource ID.

SecurityPolicy

SecurityPolicy association for AzureFrontDoor profile

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.deploymentStatus

DeploymentStatus

properties.parameters SecurityPolicyPropertiesParameters:

SecurityPolicyWebApplicationFirewallParameters

object which contains security policy parameters

properties.profileName

string

The name of the profile which holds the security policy.

properties.provisioningState

AfdProvisioningState

Provisioning status

systemData

SystemData

Read only system data

type

string

Resource type.

SecurityPolicyUpdateParameters

The JSON object containing security policy update parameters.

Name Type Description
properties.parameters SecurityPolicyPropertiesParameters:

SecurityPolicyWebApplicationFirewallParameters

object which contains security policy parameters

SecurityPolicyWebApplicationFirewallAssociation

settings for security policy patterns to match

Name Type Description
domains

ActivatedResourceReference[]

List of domains.

patternsToMatch

string[]

List of paths

SecurityPolicyWebApplicationFirewallParameters

The json object containing security policy waf parameters

Name Type Description
associations

SecurityPolicyWebApplicationFirewallAssociation[]

Waf associations

type string:

WebApplicationFirewall

The type of the Security policy to create.

wafPolicy

ResourceReference

Resource ID.

SystemData

Read only system data

Name Type Description
createdAt

string

The timestamp of resource creation (UTC)

createdBy

string

An identifier for the identity that created the resource

createdByType

IdentityType

The type of identity that created the resource

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

An identifier for the identity that last modified the resource

lastModifiedByType

IdentityType

The type of identity that last modified the resource