Skip to content

Conversation

kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Aug 14, 2025

Rationale for this change

Closes #2328

Pass token string as credential in AzureBlobFileSystem, https://fsspec.github.io/adlfs/api/
This is a known workaround as described by Azure/azure-sdk-for-python#9075 (comment)

I've also made a feature request for java implementation apache/iceberg#13818

Note, pyarrow.fs.AzureFileSystem does not currently expose credential as a parameter

Are these changes tested?

Yes, manually since azurite does not integrate with entra.

heres a repro script

from azure.identity import DefaultAzureCredential
import pyarrow as pa

credential = DefaultAzureCredential()
token = credential.get_token("https://storage.azure.com/.default").token

warehouse = "abfss://[email protected]/kevinliu_demo_lh.Lakehouse/Files"
account_name = "daily-onelake"
account_host = f"{account_name}.blob.fabric.microsoft.com"

catalog = load_catalog("default", **{
    "type": "in-memory", 
    "warehouse": warehouse,
    "adls.account-name": account_name,
    "adls.account-host": account_host,
    "adls.token": token,
})

catalog.create_namespace_if_not_exists("default")
try:
    catalog.drop_table("default.test")
except:
    ...


TEST_DATA = {
    "id": [1, 2, 3, 1, 1],
    "name": ["AB", "CD", "EF", "CD", "EF"],
}
arrow_table = pa.Table.from_pydict(TEST_DATA)
tbl = catalog.create_table_if_not_exists("default.test", schema=arrow_table.schema)
tbl.append(arrow_table)
tbl.scan().to_arrow()

Are there any user-facing changes?

@kevinjqliu kevinjqliu requested a review from Fokko August 14, 2025 20:44
@kevinjqliu kevinjqliu added this to the PyIceberg 0.10.0 milestone Aug 14, 2025
@Fokko Fokko changed the title add support to configure entra token in fsspec's adls filesystem fsspec: Support token in ADLS Aug 18, 2025
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for fixing this @kevinjqliu

@djouallah looking forward seeing your findings 👍

@Fokko Fokko merged commit 2cba3b7 into apache:main Aug 18, 2025
11 checks passed
@djouallah
Copy link

djouallah commented Aug 19, 2025

@Fokko yes it works :)

image

@Fokko
Copy link
Contributor

Fokko commented Aug 19, 2025

@djouallah Awesome, thanks for letting us know!

@kevinjqliu kevinjqliu deleted the kevinjqliu/adls-token branch August 19, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyiceberg azure should support token

3 participants