How to update managed attributes for an asset and classification of individual columns of any entity in Microsoft Purview using API?

Divya Mishra 15 Reputation points
2023-07-17T12:05:08.2933333+00:00

What we tried:

  1. I've implemented adding classification at Asset level. PFA the code snippet that I tried-
for classification_index in range(0,len(classification_list)-1):        classifications = classifications + '{ "typeName": "' + classification_list[classification_index] +'"},'    classifications = classifications +'{ "typeName": "' + classification_list[len(classification_list)-1] +'"}]'  classificationPostUrl = f'https://
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,126 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Tamara Titova 5 Reputation points Microsoft Employee
    2023-09-08T17:25:33.51+00:00

    Hello, could you try to use the option businessAttributeUpdateBehavior=replace on your POST requests to update managed attributes? Recently Purview team advised to me to do the steps I share below, and it worked. Sharing with you and hope it will work for you too.

    Steps:

    1. Create your managed attribute in Purview if you have not already: Microsoft Purview -> Data map -> Managed Attributes -> create attribute group (YOUR_ATTRIBUTE_GROUP_NAME) and specify an attribute under the group (YOUR_ATTRIBUTE_NAME)
    2. Example of an entity POST request should look like: https://{{YOUR_PURVIEW_ACCOUNT_NAME}}.catalog.purview.azure.com/api/atlas/v2/entity?businessAttributeUpdateBehavior=replace
    3. Body will have to contain the section for managed attributes. Basic skeleton:
    {
           "entity": {
            "typeName": "ENTITY_TYPE",
            "attributes": { ... },
            "guid": "ENTITY_GUID",
            "relationshipAttributes": { ... },
            "businessAttributes": {
                "YOUR_ATTRIBUTE_GROUP_NAME": {
                    "YOUR_ATTRIBUTE_NAME": "VALUE_YOU_D_LIKE_TO_ASSIGN"
                }
            },
            "displayText": "ENTITY_DISPLAY_TEXT"
        }
    }
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.