How to update contact details in Purview through azure-purview-catalog python package

Ravineesh 80 Reputation points
2024-02-15T16:33:36.8666667+00:00

I'm trying to update the contact details of the table using the azure-purview-catalog python package.

from azure.purview.catalog import PurviewCatalogClient
from azure.identity import DefaultAzureCredential

credential = DefaultAzureCredential()
client = PurviewCatalogClient(endpoint=f"https://{os.environ['PURVIEW_NAME']}.purview.azure.com", credential=credential

I'm trying to use the function: create_or_update(), as per the argument received by the function which is a JSON object, I'm passing the below data

{'entity': {'contacts': {'Expert': [{'id': 'xxxxxxxxxxxx', 'info': 'xxxxxxxxxx'}], 'Owner': [{'id': 'xxxxxxxxxxxxxxxxxx', 'info': 'xxxxxxxxxxxxxxxxx'}]}, 'guid': 'table_guid'}}

Below is the error I'm receiving while trying to update the contact details of the table.

client.entity.create_or_update(contact_data)

Error:
HttpResponseError: Operation returned an invalid status 'Bad Request' Content: {"requestId":"967ceef8-cc1b-11ee-bb2e-00163ee189fd","errorCode":"ATLAS-400-00-014","errorMessage":"Type ENTITY with name null does not exist"}

I'm not sure what is being done wrong here, I've formatted the JSON input as it is supposed to be expected by the function. Please let me know, how to fix this. I can't find any suitable example for this task.

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,224 questions
{count} votes

Accepted answer
  1. Michael Robson 75 Reputation points Microsoft Employee
    2024-02-23T15:58:56.2333333+00:00

    @Ravineesh I have a sample script using native python/REST calls to bulk assign ownership. It might help: https://github.com/mrobson1975/purview-api-cookbook/blob/main/entity/entity-bulk-assign-owner.ipynb

    0 comments No comments

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.