Get all Mount points on Synapse Spark

Anonymous
2021-11-05T18:15:56.493+00:00

hi , I mounted ADLS on "/mnt/mdpdevfs" , hwo do i get all mount points , when i try display(mssparkutils.fs.mounts()) im getting thsi error - AttributeError: module 'notebookutils.mssparkutils.fs' has no attribute 'mounts' . ![146920-capture.png][1] ![146860-capture.png][2] ![146971-capture.png][3] [1]: /api/attachments/146920-capture.png?platform=QnA [2]: /api/attachments/146860-capture.png?platform=QnA [3]: /api/attachments/146971-capture.png?platform=QnA

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.
4,335 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 76,511 Reputation points Microsoft Employee
    2021-11-08T05:21:37.357+00:00

    Hello anonymous user,

    Thanks for the question and using MS Q&A platform.

    synfs will be used as schema instead of part of mounted path.

    Example assuming you trigger to mountname chepraadlsgen2.

    • Access the data using local file API, the path format like: /synfs/{jobId}/mountname/{filename}
    • Access the data using mounted path with mssparkutils fs API, the path will little difference and like: synfs:/{jobId}/mountname/{filename}

    147234-image.png

    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 how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Martin Scott 6 Reputation points
    2022-11-18T13:02:29.973+00:00

    Bit late to the party.

    Use...

    import glob

    jobId = mssparkutils.env.getJobId()
    print(glob.glob(f"/synfs/{jobId}/*"))

    This will list any mount points in the Synapse file system for the current job.

    ['/synfs/149/mdl_dfs', '/synfs/149/mdl_blob', '/synfs/149/mdl']

    1 person found this answer helpful.