How can I set config options when using the command-line tools?


robin@...
 

Hi,

I'm trying to use the rio command-line tool to access datasets hosted on private Azure Blob Storage.

When using GDAL, a command like this works:

gdalinfo /vsiaz/images-private/SPOT_ROI.tif --config AZURE_STORAGE_CONNECTION_STRING "SECRET HERE"

Or, alternatively, GDAL picks up that config from an environment variable of the same name.

Running:

rio info "az://images-private/SPOT_ROI_COG.tif"

Gives an error saying it can't resolve the host robinanglotest.blob.core.windows.net. I couldn't work out what was going on, as GDAL could obviously resolve the host - but then I tried running Python code where I can set the config option directly:

with rasterio.Env(CPL_CURL_VERBOSE=True, AZURE_STORAGE_CONNECTION_STRING="SECRET"):
    print(img.shape)
    data = img.read()

And it worked fine, with no errors. I assume the command-line tool wasn't picking up the correct config somehow.

How do I go about setting the same AZURE_STORAGE_CONNECTION_STRING config setting so that it works on the command line? There doesn't seem to be an equivalent --config option.

Apologies if this is simple, but I can't seem to find it in the docs and it's been confusing me,

Robin

Join main@rasterio.groups.io to automatically receive all group messages.