Hello @NishimuraChinatsu-9854 ,
Thanks for the question and using MS Q&A platform.
Rather than writing python script to list the files, you can use the built-in package named Microsoft Spark Utilities.
What is Microsoft Spark Utilities?
Microsoft Spark Utilities (MSSparkUtils) is a builtin package to help you easily perform common tasks. You can use MSSparkUtils to work with file systems, to get environment variables, to chain notebooks together, and to work with secrets. MSSparkUtils are available in PySpark (Python), Scala, and .NET Spark (C#) notebooks and Synapse pipelines.
Steps to list the Excel data stored in the RAW folder in the blob with a python script for notebook activity:
Step1: Get the ABFSS path of the Raw directory
.
Step2 Use mssparkutils.fs.ls
to list files in the Raw directory.
For more details, refer to Introduction to Microsoft Spark Utilities.
Hope this will help. Please let us know if any further 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