Forum Discussion

kur83's avatar
kur83
Helper I
1 year ago

Fabric One Lake Shortcut using Rest API - getting error - The caller is not authenticated to access

Fabric One Lake Shortcut using Rest API - getting error - The caller is not authenticated to access. It asks for ConnectionID and when I try to use it it gives error - Fabric One Lake Shortcut using Rest API - getting error - The caller is not authenticated to access .

 

This connection was created by teammate and he has granted owner access to me. 

 

'request_url': 'https://api.fabric.microsoft.com/v1/workspaces/<>/items/<>/shortcuts?shortcutConflictPolicy=Abort',
'response_text': {'requestId': '<>',
  'errorCode': 'Unauthorized',
  'message': 'The caller is not authenticated to access this resource'},
'status': 'error',
'status_code': 401,
'status_description': 'unauthorized'}.

 

 

This works for the user who created this connection. What's resolution for this?

3 Replies

  • prasbharat's avatar
    prasbharat
    Frequent Visitor

    The 401 Unauthorized error you're encountering is likely due to a limitation in the Microsoft Fabric REST API. Specifically, not all Fabric APIs, including those related to OneLake Shortcuts, currently support Service Principal authentication, even if the Service Principal is an admin of the workspace.

     

    1. Workaround for Unsupported APIs:

      • Use user delegation authentication. Authenticate the API request using a user account with sufficient permissions (e.g., owner or admin)

    Reference:

    This ensures you’re using the correct authentication method and staying aligned with Microsoft’s supported configurations. 

    If this post helps you resolve the issue, please consider accepting it as the solution to help other members find it more quickly. If you still have additional questions, feel free to let me know, and I’ll be happy to assist further. Thanks a lot!

  • Fabric One Lake Shortcut using Rest API - getting error - The caller is not authenticated to access. It asks for ConnectionID and when I try to use it it gives error - Fabric One Lake Shortcut using Rest API - getting error - The caller is not authenticated to access .

     

    This connection was created by teammate and he has granted owner access to me. 

     

    'request_url': 'https://api.fabric.microsoft.com/v1/workspaces/<>/items/<>/shortcuts?shortcutConflictPolicy=Abort',
    'response_text': {'requestId': '<>',
      'errorCode': 'Unauthorized',
      'message': 'The caller is not authenticated to access this resource'},
    'status': 'error',
    'status_code': 401,
    'status_description': 'unauthorized'}.

     

     

    This works for the user who created this connection and gives error while I authenticate using Service Principal. Service Principal is admin of the workspace.

     

    What's resolution for this?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi kur83 

     

    This REST API is for creating new shortcuts. In addition to the destination of the shortcut, your account or service principal also needs to have the necessary access to the data source. Please make sure your account or the service principal have the appropriate permissions on both sides. 

    OneLake Shortcuts - Create Shortcut - REST API (Core) | Microsoft Learn

     

    Best Regards,
    Jing
    Community Support Team