Metadata Policy - Update

Updates a metadata policy

PUT {Endpoint}/policyStore/metadataPolicies/{policyId}?api-version=2021-07-01-preview

URI Parameters

Name In Required Type Description
Endpoint
path True

string

The endpoint of your Purview account. Example: https://{accountName}.purview.azure.com.

policyId
path True

string

Unique policy id.

api-version
query True

string

The api version to use.

Request Body

Name Type Description
id

string

The id of policy

name

string

The name of policy

properties

MetadataPolicyProperties

version

integer

The version of policy

Responses

Name Type Description
200 OK

MetadataPolicy

Success

Other Status Codes

ErrorResponseModel

An error response received from the Metadata Policy Service

Headers

x-ms-error-code: string

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

MetadataPolicy_Update

Sample Request

PUT {Endpoint}/policyStore/metadataPolicies/98ed42ff-b67f-44df-8c8c-7e6b43e77055?api-version=2021-07-01-preview

{
  "name": "policy_mycollection",
  "id": "98ed42ff-b67f-44df-8c8c-7e6b43e77055",
  "version": 1,
  "properties": {
    "description": "",
    "decisionRules": [
      {
        "effect": "Permit",
        "dnfCondition": [
          [
            {
              "attributeName": "resource.purview.collection",
              "attributeValueIncludes": "mycollection"
            },
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "permission:mycollection"
            }
          ]
        ]
      }
    ],
    "attributeRules": [
      {
        "id": "purviewmetadatarole_builtin_collection-administrator:mycollection",
        "name": "purviewmetadatarole_builtin_collection-administrator:mycollection",
        "dnfCondition": [
          [
            {
              "attributeName": "principal.microsoft.id",
              "attributeValueIncludedIn": [
                "69e520f2-5f26-4074-9fe1-5187d85ec005",
                "3f10f245-d5c4-4541-98ce-01a4580a30e0"
              ]
            },
            {
              "attributeName": "derived.purview.role",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator"
            }
          ],
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:myparentcollection"
            }
          ]
        ]
      },
      {
        "id": "permission:mycollection",
        "name": "permission:mycollection",
        "dnfCondition": [
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:mycollection"
            }
          ],
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "permission:myparentcollection"
            }
          ]
        ]
      }
    ],
    "collection": {
      "referenceName": "mycollection"
    },
    "parentCollectionName": "myparentcollection"
  }
}

Sample Response

x-ms-request-id: d5496da4-9c52-402f-b067-83cc9ddea888
{
  "name": "policy_mycollection",
  "id": "98ed42ff-b67f-44df-8c8c-7e6b43e77055",
  "version": 2,
  "properties": {
    "description": "",
    "decisionRules": [
      {
        "kind": "decisionrule",
        "effect": "Permit",
        "dnfCondition": [
          [
            {
              "attributeName": "resource.purview.collection",
              "attributeValueIncludes": "mycollection"
            },
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "permission:mycollection"
            }
          ]
        ]
      }
    ],
    "attributeRules": [
      {
        "kind": "attributerule",
        "id": "purviewmetadatarole_builtin_collection-administrator:mycollection",
        "name": "purviewmetadatarole_builtin_collection-administrator:mycollection",
        "dnfCondition": [
          [
            {
              "attributeName": "principal.microsoft.id",
              "attributeValueIncludedIn": [
                "69e520f2-5f26-4074-9fe1-5187d85ec005",
                "3f10f245-d5c4-4541-98ce-01a4580a30e0"
              ]
            },
            {
              "attributeName": "derived.purview.role",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator"
            }
          ],
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:myparentcollection"
            }
          ]
        ]
      },
      {
        "kind": "attributerule",
        "id": "permission:mycollection",
        "name": "permission:mycollection",
        "dnfCondition": [
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:mycollection"
            }
          ],
          [
            {
              "attributeName": "derived.purview.permission",
              "attributeValueIncludes": "permission:myparentcollection"
            }
          ]
        ]
      }
    ],
    "collection": {
      "type": "CollectionReference",
      "referenceName": "mycollection"
    },
    "parentCollectionName": "myparentcollection"
  }
}

Definitions

Name Description
AttributeMatcher

Attribute matcher for a rule

AttributeRule

The attribute rule for a policy

CollectionReference

The collection reference for a policy

Decision

The effect for rule

DecisionRule

The decision rule for a policy

ErrorModel

The error model for metadata policy

ErrorResponseModel

The error response model for metadata policy

Kind

The kind of rule

MetadataPolicy
MetadataPolicyProperties

AttributeMatcher

Attribute matcher for a rule

Name Type Description
attributeName

string

AttributeName

attributeValueExcludedIn

string[]

List of values excluded for attribute

attributeValueExcludes

string

Value excluded for attribute

attributeValueIncludedIn

string[]

List of values for attribute

attributeValueIncludes

string

Value for attribute

AttributeRule

The attribute rule for a policy

Name Type Description
dnfCondition

AttributeMatcher[]

The dnf Condition for a rule

id

string

The id for rule

kind

Kind

The kind of rule

name

string

The name for rule

CollectionReference

The collection reference for a policy

Name Type Default Value Description
referenceName

string

The name of reference

type

string

CollectionReference

The type of reference

Decision

The effect for rule

Name Type Description
Deny

string

Permit

string

DecisionRule

The decision rule for a policy

Name Type Description
dnfCondition

AttributeMatcher[]

The dnf Condition for a rule

effect

Decision

The effect for rule

kind

Kind

The kind of rule

ErrorModel

The error model for metadata policy

Name Type Description
code

string

The error code

details

ErrorModel[]

The error details

message

string

The error message

target

string

The error target

ErrorResponseModel

The error response model for metadata policy

Name Type Description
error

ErrorModel

The error model for metadata policy

Kind

The kind of rule

Name Type Description
decisionrule

string

MetadataPolicy

Name Type Description
id

string

The id of policy

name

string

The name of policy

properties

MetadataPolicyProperties

version

integer

The version of policy

MetadataPolicyProperties

Name Type Description
attributeRules

AttributeRule[]

The AttributeRules of policy

collection

CollectionReference

The collection reference for a policy

decisionRules

DecisionRule[]

The DecisionRules of policy

description

string

The description of policy

parentCollectionName

string

The parent collection of the policy