cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

I have an Azure storage account, and I need to list the containers on that storage account using scala from databricks notebook

ebg
New Contributor III

I tried to run azure-cli on databricks (i am using Credential passthrough and my account needs MFA ) and do the following code:

az storage container list --account-name "account_name" --auth-mode login --query "[].name" --output tsv

However, it outputs the following error:

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CP4XQ7YMD to authenticate.

ERROR: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling.

Trace ID: a950d1bc-d7c0-43c6-8f92-09f108756c02

Correlation ID: 62d21988-966e-46ec-a300-fe7101c1e64e

Timestamp: 2022-10-12 09:31:45Z

Interactive authentication is needed. Please run:

az login

any other way I can list all the containers in a storage account?

3 REPLIES 3

Matt101122
Contributor

@elias bou ghosn​ see if any of these options are helpful: https://docs.databricks.com/external-data/azure-storage.html

PriyaAnanthram
Contributor III

dbutils.fs.ls after mounting the adls gen2 should work I think

Anonymous
Not applicable

Hi @elias bou ghosn​ 

Hope all is well!

Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group