fsspec/adlfs

support az cli config ~/.azure/config

efiop opened this issue · 1 comments

efiop commented

We currently support env vars, but we should also support azure config file

adlfs/adlfs/spec.py

Lines 251 to 253 in 55ba981

self.sas_token = sas_token or os.getenv("AZURE_STORAGE_SAS_TOKEN")
self.client_id = client_id or os.getenv("AZURE_STORAGE_CLIENT_ID")
self.client_secret = client_secret or os.getenv("AZURE_STORAGE_CLIENT_SECRET")

The way to do it is through knack, we currently do it ourselves in dvc:

https://github.com/iterative/dvc-azure/blob/906cdc22e7d44c027060e49aa94cddbec8e3a8cc/dvc_azure/__init__.py#L26

but it would be really nice and generally useful to have it in adlfs. It should be a simple drop-in replacement for the getenv calls that we have.

This is also similar to how s3fs supports aws config, so seems to be logical to support it in adlfs.

efiop commented

Actually looking at s3fs, I don't see it parsing aws config and I see that we do that explicitly in dvc-s3. I'll close this for now.