Service Principal grant permission to access Purview data assets(Entity)

宇翔 刘 21 Reputation points
2025-02-20T05:47:59.8566667+00:00

I have a service principal that want to access data assets in Microsoft Purview.

The service principal is used in a python program, thus I use python sdk to access the purview instance.

Strangely, it can only return an empty list of data assets. But the assets actually exist and can be found in Purview portal.

The api I use is shown below.

client.discovery.query({"keywords": "*"})
Microsoft Security | Microsoft Purview
{count} votes

Accepted answer
  1. Chandra Boorla 14,685 Reputation points Microsoft External Staff Moderator
    2025-02-20T10:46:48.1333333+00:00

    @宇翔 刘

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Issue:

    Service Principal grant permission to access Purview data assets(Entity)

    Solution:

    "I have resolved the issue. The problem was due to selecting an incorrect targeted deployment."

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    Hope this helps. Do let us know if you have 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.


1 additional answer

Sort by: Most helpful
  1. 宇翔 刘 21 Reputation points
    2025-02-20T10:18:23.7033333+00:00

    The issue is resolved by myself. I chose a wrong targeted deployment that containing another set of client_id, client_secret and tenant


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.