question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Use adlfs to access public blobs

See original GitHub issue

Originally posted it at https://stackoverflow.com/questions/63856476/adlfs-create-azureblobfilesystem-with-credential-none but should probably post here. Need rep points to create a adlfs tag and fsspec tags…

I’m going through this: https://azure.microsoft.com/en-us/services/open-datasets/catalog/goes-16/

and I was curious how to do the equivalent of s3fs.S3FileSystem(anon=True) with adlfs.AzureBlobFileSystem.

It seems credential=None is a good candidate (https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python) but as far as i’m aware it hasn’t been implemented?

>>> import adlfs
>>> fs = adlfs.AzureBlobFileSystem(credential=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ray/local/bin/anaconda3/envs/test_env/lib/python3.8/site-packages/fsspec/spec.py", line 52, in __call__
    obj = super().__call__(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'account_name'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
hayesgbcommented, Sep 22, 2020

I’ve added anonymous authentication to AzureBlobFileSystem with #106 and #107 so the above goes example works as follows:

storage_options = {'account_name': 'goes'}
fs = AzureBlobFileSystem(**storage_options)
fs.ls("noaa-goes16")

An example Jupyter Notebook on Azure can be found here. The above doesn’t work if you just try fs.ls("/").

I believe @raybellwaves is right – the trick is making sure you get the account_name and container right.

BTW – The GOES data is stored in xarray, so I didn’t try opening the file.

Also successfully accessed the data here as follows:

storage_options={"account_name": "hlssa"}
fs = AzureBlobFileSystem(**storage_options)
fs.ls("hls")
ddf = dd.read_csv("abfs://hls/S2_TilingSystem2-1.txt", storage_options=storage_options)

Both .head() and .tail() work tag: @lostmygithubaccount

1reaction
hayesgbcommented, Sep 25, 2020

I’m trying to get to releases on the first week of the month. You can install what’s in the master branch directly with pip from github if you need it now.

On Sep 24, 2020, at 12:28 PM, Cody notifications@github.com wrote:

will this be published to pypi soon @hayesgb ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: a public dataset · Issue #117 · fsspec/adlfs
I would love to see an example of simple anonymous access to ABS with adlfs. In pangeo-forge/pangeo-forge-recipes#267, I open the file https:// ...
Read more >
Configure anonymous public read access for containers and ...
Learn how to allow or disallow anonymous access to blob data for the storage account. Set the container public access setting to make ......
Read more >
Access Azure Data Lake Storage Gen2 and Blob Storage
This article details how to access Azure storage containers using: Unity Catalog managed external locations. Azure service principals. SAS ...
Read more >
Securing Azure Blob Storage: Set-Up Guide - Varonis
Securing access to your Blob storage is a critical step for any ... read or write requests against Blob storage can use an...
Read more >
Filesystem Interface — Apache Arrow v10.0.1
import pyarrow.parquet as pq # using a URI -> filesystem is inferred ... host name since there are different host names for authenticated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found