Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Access token to call Fabric API

Hello,

I need to use Fabric API to run notebook. I have created app registration for this purpose. I get the token but when I use it to call Fabric API, a get error 

{"requestId":"852e1ecc-6970-4d4e-bea7-9baeb5d177df","errorCode":"Unauthorized","message":"The caller is not authenticated to access this resource"}.
 
from azure.identity import ClientSecretCredential
tenant_id = 'xxx'
client_id = 'xxx'
client_secret = 'xxx'
client_secret_credential_class = ClientSecretCredential(tenant_id=tenant_idclient_id=client_idclient_secret=client_secret)
access_token_class = client_secret_credential_class.get_token(scope)
token_string = access_token_class.token

. . . then I use it to get workspaces

responserequests.Response = requests.get(url=urlheaders=get_headers())

 

Where could be problem? What do I wrong?

Thanks

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous ,

      We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
      In case if you have any resolution please do share that same with the community as it can be helpful to others .
      Otherwise, will respond back with the more details and we will try to help .
      Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,

    sorry for my late answer. I hadn't enough time to study the links but I belive it will help me. I think that I can accept your recommended materials as solution. In case of other question I would open new topic. Thanks very much.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

      Glad to know that your query got resolved. Please continue using Fabric Community on your further queries.

  • Salini1991's avatar
    Salini1991
    Frequent Visitor

    Was this resolved? I am facing the same issue. Could you please help?