Recently I got a requirement to connect to ADLS Gen2 and download all the files from ADLS to a linux machine. I had prepared a python program that connects to the storage account using connection string. But when I requested the connection string, the IT team told me that they cannot provide the connection string and they requested me to connect using a service principle. So I had to modify the program to make it connect using service principle.
We need two python packages to run this program. The packages are given below.
The core part of the program that establishes connection to the storage account is given below.
I hope this tip helps someone 🙂 . Feel free to comment if you have any questions.