Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

getAccessToken

in function getAccessToken which identity does it take to authenticate

  • Hi Anonymous 


    Welcome to the Microsoft Fabric Forum.  Also ,Thank you nilendraFabric  for the contribution.

     

    In Microsoft Fabric, getAccessToken authenticates using the identity associated with the execution context. For internal Fabric resources such as OneLake, this is typically the Workspace Managed Identity. When accessing external services or APIs, the token is obtained using the identity configured in the resource connection, which could be a user identity, managed identity, or service principal.

     

    In notebooks, interactive runs use the signed-in user's identity, whereas scheduled runs or pipeline executions use the Run As identity configured in the job or pipeline settings.This ensures secure and context-aware access to both internal and external resources within the Fabric environment.

     

    If this information helps resolve your issue, kindly consider marking this response as the Accepted Solution, as it may assist other community members facing similar challenges.

     

    Thank you for being part of the Microsoft Fabric Community.

  • Hi Anonymous ,

     

    The getAccessToken function typically uses the identity of the user or service principal that is executing the request. In the context of Microsoft Fabric or Azure, this could be:

    • A Managed Identity (if running in a service like Azure Data Factory or Synapse)
    • A User Identity (if triggered by a logged-in user)
    • A Service Principal (if using an app registration)

    To determine exactly which identity is used, check the authentication context or logs of the service executing the function.

    Hope this helps!

     

4 Replies

  • Hi Anonymous 

     

    getAccessToken authenticates using the identity configured for the resource connection-most commonly the workspace identity for workspace resources, or the user/service principal identity for direct API access

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi Anonymous 


    Welcome to the Microsoft Fabric Forum.  Also ,Thank you nilendraFabric  for the contribution.

     

    In Microsoft Fabric, getAccessToken authenticates using the identity associated with the execution context. For internal Fabric resources such as OneLake, this is typically the Workspace Managed Identity. When accessing external services or APIs, the token is obtained using the identity configured in the resource connection, which could be a user identity, managed identity, or service principal.

     

    In notebooks, interactive runs use the signed-in user's identity, whereas scheduled runs or pipeline executions use the Run As identity configured in the job or pipeline settings.This ensures secure and context-aware access to both internal and external resources within the Fabric environment.

     

    If this information helps resolve your issue, kindly consider marking this response as the Accepted Solution, as it may assist other community members facing similar challenges.

     

    Thank you for being part of the Microsoft Fabric Community.

  • Hi Anonymous ,

     

    The getAccessToken function typically uses the identity of the user or service principal that is executing the request. In the context of Microsoft Fabric or Azure, this could be:

    • A Managed Identity (if running in a service like Azure Data Factory or Synapse)
    • A User Identity (if triggered by a logged-in user)
    • A Service Principal (if using an app registration)

    To determine exactly which identity is used, check the authentication context or logs of the service executing the function.

    Hope this helps!

     

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi Anonymous 

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.