question

SasanapuriYogesh-5842 avatar image
0 Votes"
SasanapuriYogesh-5842 asked deherman-MSFT answered

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

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-blob-storageazure-data-lake-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

deherman-MSFT avatar image
0 Votes"
deherman-MSFT answered

@SasanapuriYogesh-5842
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.