Skip to content

Commit 47bf8ae

Browse files
committed
ADLS: Support Vended Credentials
First version with `Fsspec`. Will check with PyArrow tomorrow, but that one seems to be lacking the SAS token: https://arrow.apache.org/docs/cpp/api/filesystem.html#azure-filesystem Closes #1146
1 parent b806cfa commit 47bf8ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pyiceberg/io/fsspec.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ def _gs(properties: Properties) -> AbstractFileSystem:
179179
def _adls(properties: Properties) -> AbstractFileSystem:
180180
from adlfs import AzureBlobFileSystem
181181

182+
for key, sas_token in {
183+
key.replace(f"{ADLS_SAS_TOKEN}.", ""): value
184+
for key, value in properties.items()
185+
if key.startswith(ADLS_SAS_TOKEN) and key.endswith(".windows.net")
186+
}.items():
187+
if ADLS_ACCOUNT_NAME not in properties:
188+
properties[ADLS_ACCOUNT_NAME] = key.split(".")[0]
189+
if ADLS_SAS_TOKEN not in properties:
190+
properties[ADLS_SAS_TOKEN] = sas_token
191+
182192
return AzureBlobFileSystem(
183193
connection_string=properties.get(ADLS_CONNECTION_STRING),
184194
account_name=properties.get(ADLS_ACCOUNT_NAME),

0 commit comments

Comments
 (0)