Microsoft Purview

This article shows how to access Microsoft Purview data through Zetaris Lightning Platform

Pre-Requisites

Microsoft Purview setup

  1. Create a purview account in azure. Refer Create an Azure Purview account in the Azure portal article for the details on creating a purview account.
  2. Create sample collection under Microsoft Purview Data Map. Refer How to create and manage collections - Microsoft Purview article for the details on creating a collection.
  3. Create a service principal which will be used to access the API. Refer Create a Service Principal article for the details on creating the service principal.
  4. Grant the service principal Data Curator role for the purview account you created in Step 1. Refer Grant “Purview Data Curator” Role article for details on how to grant the role.
  5. Collect the following information from Service Principle and Microsoft Purview account which you will need in the next steps –
    • Tenant id

    • Service principal client id

    • Service principal client secret

    • Microsoft Purview account name

Microsoft Purview account setup is optional, skip this step if you already have Purview account and make sure you have required information as specified in Step 5 to connect API through Zetaris Platform.

Establishing connection to Microsoft Purview

Once Microsoft Purview account is ready, we can connect Data Catalogs through Zetaris Lightning Platform via the REST API.

Connect via NDP Fabric Builder

  1. Select the NDP Fabric Builder 
  2. Select the  icon next to virtual file sources, then create "MICROSOFT_PURVIEW" source
  3. Select the icon next to the MICROSOFT_PURVIEW and then enter the necessary fields outlined in the below image for API OAuth Management.
  4. Select the icon next to the MICROSOFT_PURVIEW created data source and then select "API"
  5. Enter the necessary fields as outlined in the screenshot below:
  6. Finalise connection.
  7. Explore data

Connect via SQL Editor

Example connection string below with Access token authentication:

UPSERT AUTH purview_auth REQUEST(
     endpoint "https://login.microsoftonline.com//oauth2/token",
     method "post",
     http_encoding "urlencoded"
) HEADER (
) BODY (
      grant_type "client_credentials",
      resource "https://purview.azure.net",
      client_id "",
      client_secret ""
);
CREATE LIGHTNING DATABASE MICROSOFT_PURVIEW DESCRIBE BY "MP" OPTIONS ();

CREATE LIGHTNING REST TABLE ASSETS FROM MICROSOFT_PURVIEW REQUEST(
    endpoint "https://.catalog.purview.azure.com/api/search/query?api-version=2022-03-01-preview",
    method "POST",
    http_encoding "JSON",
    response_type "json"
) HEADER (
   Authorization "Bearer ${access_token}",
   Content-Type "application/json"
) BODY (
    limit "10",
    offset "0"
    )
AUTH BY purview_auth;

select a.collectionId,a.assetType,a.entityType,a.name,a.objectType,a.glossaryType,a.id,a.createBy,a.createTime,a.updateBy,a.updateTime
from(select explode(value) a from MICROSOFT_PURVIEW.ASSETS)

References