Synapse Spark: mssparkutils.fs.mount - Access token couldn't be obtained

Jason Campbell 51 Reputation points
2022-11-10T00:43:01.21+00:00
mssparkutils.fs.mount(   
    "abfss://******@mydatalake.dfs.core.windows.net",   
    "/temp",   
    {"linkedService":"DataLakeGen2_Linked_Service"}   
)   

When I run the above it gives me:

Py4JJavaError: An error occurred while calling z:mssparkutils.fs.mount.
: com.microsoft.spark.notebook.msutils.InvalidCredentialsException: fetch Token from linkedService failed with Access token couldn't be obtained {"result":"DependencyError","errorId":"BadRequest","errorMessage":"LSRServiceException is [{\"StatusCode\":400,\"ErrorResponse\":{\"code\":null,\"message\":null,\"target\":null},\"StackTrace\":\"

Any ideas?
The linked service works fine. Test connection is successful.

thanks,
Jason

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,379 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jason Campbell 51 Reputation points
    2022-11-13T20:29:16.493+00:00

    I was able to mount the storage when I used a linked service that used a private endpoint. Looks like my organisation had locked down the linked service that was missing the private endpoint.

    Now that it's mounted, the Geopandas read is still not seeing the file as if it was on the local storage. Mounting the storage should have worked - or is there another consideration that I am missing?

    e.g.

    mssparkutils.fs.mount(
    "abfss://******@mydatalake.dfs.core.windows.net",
    "/temp",
    {"linkedService":"DL_Linked_Service"}
    )

    1 person found this answer helpful.

  2. PRADEEPCHEEKATLA 90,651 Reputation points Moderator
    2022-11-10T11:23:56.47+00:00

    Hello @Jason Campbell ,

    Thank you for question and using Microsoft Q&A Platform.

    You may experience the above error message occurs when we misspell or provide incorrect details in mount point creation code.

    Kindly make sure below checkpoints are correct to make your code:

    • Make sure your linked service test connection is successful.
    • Make sure linked service name in the mount point creation code is correct.
    • Make sure path of your storage account is correct without any spaces and spelling mistakes.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is jhow you can be part of Q&A Volunteer Moderators
    0 comments No comments

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.