To get only list of subfolder names in Directory in Azure Data Lake using Python

Sasanapuri, Yogesh 1 Reputation point
2021-10-25T10:11:36.437+00:00

I have container named infaqa and directories in infaqa as below path:
infqa/Raw/Sales/Account/2020, infaqa/Raw/Sales/Product,2020 etc.

I wanted to get list of folder names in list like ['Account','Product'...] which are sub directories of infaqa/Raw.

I am using Azure notebooks and libraries like blobserviceclient to list blobs, but I am getting error..Is there any similar approach like os.walk() method in Azure notebooks as well?

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,350 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,438 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 33,626 Reputation points Microsoft Employee
    2021-10-25T18:45:39.74+00:00

    @Sasanapuri, Yogesh
    Please see the sample code available for listing directories under a path on GitHub. Please give this a try and let us know if you run into any issues.

    Hope this helps! If you are still facing issues please provide the code you are running along with any error messages you are receiving.

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

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments