About python scripts using notebook activity

NishimuraChinatsu-9854 756 Reputation points
2022-06-23T08:45:14.133+00:00

214218-tempsnip.png

I want to list the Excel data stored in the RAW folder in the blob with a python script for notebook activity.

I'm sorry for lack of study.
I've rewritten the python code many times, but I can't do it well, so please let me know.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,082 questions
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,186 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,541 Reputation points
    2022-06-24T08:37:15.187+00:00

    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.

    214734-image.png

    Step2 Use mssparkutils.fs.ls to list files in the Raw directory.

    214761-image.png

    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 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
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.