0

We did a Purview Scan of an Azure SQL Database. Now many of the SQL tables have been dropped from the database. But those assets (tables in Purview) are still in Purview. We want to delete those assets using a REST API.

Using PyApacheAtlas, a delete operation across many assets can be as simple as this delete sample.

Question: If we have an EXCEL file with a list of assets with their corresponding DUIDs, is there a way to read that list and delete the assets using the sample code in link 2 above. The link 1 above talks about doing some bulk upload operations using an EXCEL file. I was wondering how can we achive the same for bulk delete of assets of same types. Something similar is explained here. But I've not been able to simulate the same for bulk delete. Maybe, someone can help.

nam
  • 21,967
  • 37
  • 158
  • 332

1 Answers1

0

The only way to delete multiple assets from the catalog is through REST APIs.

Steps to delete an Asset in Purview using REST API:

From this document, follow the steps to Use the Postman client to call the REST APIs.

Step1: Get Token

POST https://login.microsoftonline.com/<your-tenant-id>/oauth2/token  

enter image description here

Step2: How to find a guid of an asset in Azure Purview Studio. Select any asset and you will find the guid in the url section:

enter image description here

Step3: Entity - Delete By Guid – Used to delete single asset by using associated Guid:

Syntax: DELETE {Endpoint}/catalog/api/atlas/v2/entity/guid/{guid}

Sample URL: DELETE {Endpoint}/catalog/api/atlas/v2/entity/guid/fd279eb4-f6c3-1b0b-ad67-e4f8abd2972f

Step4: Entity - Delete By Guids – Used to delete mulitple asset by using associated Guid:

Syntax: DELETE {Endpoint}/catalog/api/atlas/v2/entity/bulk?guids={guids}

Sample:

DELETE {Endpoint}/catalog/api/atlas/v2/entity/bulk?guids=[  
      
      "18e06957-e265-967a-07f1-e14e2ab8940f",  
      
      "cc0730ba-9b30-41f0-6953-559d17626d2b"  
      
    ]  

For more details, refer to MS Q&A thread addressing similar issue,

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42