Thanks for reaching out to Microsoft Q&A
The Purview Query API allows you to interact with Azure Purview’s data map, enabling you to retrieve metadata about data assets, including their classifications. Here’s how it works regarding schema classifications and the differences you observed between entity types:
How Purview Query API Works on Schema Classifications
- Endpoint and Request: You use the endpoint
{endpoint}/datamap/api/search/query?api-version=2023-09-01
to send a POST request. This retrieves a list of entities along with their classifications. - Response Structure: The API response includes entities with their respective classifications. For example, in your JSON response: JSON
{ "value": [ {"displayText": "sap_entity1", "entityType": "sap_ecc_table"}, {"displayText": "sap_entity2", "entityType": "sap_ecc_table", "classification": ["Text1"]}, {"displayText": "custom_type_entity1", "entityType": "custom_type1"} ] }
- Classification Values:
For standard entities (like sap_entity1
and sap_entity2
), the classification may reflect values from the schema classifications rather than the detailed entity page.
For custom types, the classification appears directly as the classification value, not linked to schema classifications.
Addressing Your Observations
Mismatch in Classifications: The discrepancy you noted—where the classification in the API response does not match the entity detail page—can occur because the API may prioritize schema classifications over individual entity classifications for standard types. This is likely by design, as schema classifications provide a broader context for data governance.
Custom Type Entities: For custom types, the API response directly reflects the assigned classifications. If you want the custom type entities to behave similarly to non-custom types (i.e., to show schema classifications), you might need to ensure that:
- The custom types are properly configured to inherit or reference schema classifications.
- You apply the same classification rules to custom types as you do for standard types,
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.