How to remove a classification from table using purviewcli

Ravineesh 80 Reputation points
2023-11-09T13:01:14.8166667+00:00

Hello

I am a user of purviewcli, I have encountered a problem with deleting a schema classification from an table using purviewcli.

Problem: I've a classification named as MICROSOFT.GOVERNMENT.AUSTRALIA.PASSPORT_NUMBER to a column named passport_number of a table. I would like to remove this classification from the table using purviewcli. MICROSOFT.GOVERNMENT.AUSTRALIA.PASSPORT_NUMBER is a schema classification.

Approach:

I have tried to use the command pv entity deleteClassification --guid "guid_of_the_table" --classificationName "MICROSOFT.GOVERNMENT.AUSTRALIA.PASSPORT_NUMBER" but it gives me an error message saying that the classification is not associated with the entity.

{
    "errorCode": "ATLAS-400-00-06D",
    "errorMessage": "Classification MICROSOFT.GOVERNMENT.AUSTRALIA.PASSPORT_NUMBER is not associated with entity",
    "requestId": "f4d15d09-d24b-4230-aaa1-132283e097db"
}

I can verify through the Purview UI, that the classification **MICROSOFT.GOVERNMENT.AUSTRALIA.PASSPORT_NUMBER**is applied to the schema of the table. There is no clarification provided that whether the command pv entity deleteClassification works for asset classifications deletion or schema classifications deletion.

How can I delete the schema classification applied on the table by using purviewcli? Am I missing something here ?

Thanks

Azure Data Catalog
Azure Data Catalog
An Azure service that serves as a system of registration and system of discovery for enterprise data assets.
106 questions
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,273 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,266 Reputation points
    2023-11-13T04:02:00.2733333+00:00

    @Ravineesh - Thanks for the question and using MS Q&A platform.

    Issue:

    • The issue in the example provided in the previous email is due to the GUID or the schema being passed (which has no classification).

    Fix:

    • To fix the issue, pass the GUID of the column (that is the entity which has the classification applied to it). 

    How to get the GUID of a column using Developer Tools

    1. Find the table (e.g. Customer Azure SQL Table)
    2. Click Schema
    3. Open “Developer Tools” in your browser (e.g. press F12 on your keyboard)
    4. Switch to the Network tab__.__
    5. Filter the network requests by clicking on the Fetch/XHR pill.
    6. Click on the column that has the classification applied (e.g. EmailAddress). Note: By doing so, this will fire off several network requests which we will filter down in the next step.
    7. Filter the network requests by typing “bulk” in the search box.
    8. Click on the bulk?exc… network requests to reveal it’s details.
    9. Switch to the Preview tab to see the formatted response.
    10. If you expand the JSON (entities[0].guid), you should find the GUID of the column.
    11. If you expand the JSON (entities[0].classifications[0].typeName), you should find the name of the classification.

    User's image

    Example of successfully removing the classification with the correct GUID/classification combination. 

    pv entity deleteClassification --guid GUID_OF_COLUMN --classificationName NAME_OF_CLASSIFICATION

    User's image

     Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


0 additional answers

Sort by: Most helpful

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.