How to get the list of tables of a specific Purview collection with Azure Purview Catalog client library for .NET?

Bernhard Lauber 41 Reputation points
2022-03-04T17:21:40.473+00:00

Hello

here I found some documentation about the .NET library for Purview: https://learn.microsoft.com/en-us/dotnet/api/overview/azure/analytics.purview.catalog-readme-pre

In Azure Purview Studio I can do following:

  1. Browse assets
  2. Select the collection, where I did a scan
  3. Then I set the checkmark for Files in the Narrow results by area on the left side
  4. Now I get the list of all scanned files

How can I do that with the .NET library?

Regards
Bernhard

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,065 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
0 comments No comments
{count} votes

Accepted answer
  1. Saurabh Sharma 23,791 Reputation points Microsoft Employee
    2022-03-08T01:45:48.07+00:00

    Hi @Bernhard Lauber ,

    Thanks for using Microsoft Q&A !!
    As per my understanding, you wanted to list all the "FILES" of a Purview Collection using .NET SDK.

    You can follow all the steps given in the tutorial.

    You can look into Purview Catalog API file and refer all the relevant .Net C# supported APIs. As you are looking to search files you need to use Search API using filter for "Files". So, you need to use the following functions:
    public virtual Azure.Response Search (Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; }
    public virtual System.Threading.Tasks.Task<Azure.Response> SearchAsync (Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; }

    And you need to pass "objectType":"Files" in the request body to filter all and it should work for you.
    Please explore the parameters in the Purview Search API docs and go through the Discovery query types to know more about it.
    The trick to use the SDK successfully is to refer to the REST API docs alongside the SDK to make it work as desired.

    Please refer to the attached sample code which you could leverage and change accordingly to make it work as desired.
    180774-program.txt

    Please let me know if you have any questions.

    Thanks
    Saurabh

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.


0 additional answers

Sort by: Most helpful