I have an Azure storage account, and I need to list the containers on that storage account using scala from databricks notebook
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 04:40 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 07:27 AM
@elias bou ghosn see if any of these options are helpful: https://docs.databricks.com/external-data/azure-storage.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 11:14 PM
dbutils.fs.ls after mounting the adls gen2 should work I think
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 06:41 AM
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!