Hello @NishimuraChinatsu-9854 ,
Thanks for the question and using MS Q&A platform.
As I understand, the ask is whether you can use the python
os.listdir() in Synapse notebook, to navigate Azure Datalake Gen2. Also whether similar happens with Azure Functions.
Sorry I took so long, but I needed to make some corrections. I thought os.listdir could be used in conjunction with mounting, but this doesn't seem to be the case. I must have gotten confused with Databricks behavior. This excerpt from mounting api documentation doesn't help either. I'll get with my colleagues for clarification.
After the storage is in place, you can use the local file API to access data as if it's stored in the local file system
os.listdir cannot be used with abfss. This is because they are different protocols. os.listdir expects native paths like C:\mydir/mysubfolder/myfile . These can be posix or windows type file paths, (I think?).
However, abfss:// is a totally different protocol. If you look at it, it seems more similar to a URL, than a filepath.
Other operations CAN use the abfss, such as dataframe, pandas, and some spark.
Alternatively, there are other ways to navigate the storage.
You can use the mssparkutils to list the contents of a mount.
fsspec can do ls
Please do let me if you have any queries.
- Please don't forget to click on or upvote 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