Your first example wouldn’t work
rxr.open_rasterio('https://modissa.blob.core.windows.net/modis-006/MOD09Q1/22/07/2021289/MOD09Q1.A2021289.h22v07.006.2021299111058.hdf', chunks= 'auto')
since it doesn’t include the SAS token as a query parameter. I would have hoped that rxr.open_rasterio('https://modissa.blob.core.windows.net/modis-006/MOD09Q1/22/07/2021289/MOD09Q1.A2021289.h22v07.006.2021299111058.hdf?sv=2019-12-12&si=modis-ro&sr=c&sig=jauBgV7FNXyhbjO60XSMr6AnFFd5sl%2BwXsNazkOOFjs%3D', chunks= 'auto')
would work, but it fails as well.
Looking at GDAL Virtual File Systems (compressed, network hosted, etc...): /vsimem, /vsizip, /vsitar, /vsicurl, ... — GDAL documentation, it seems like GDAL doesn’t support opening netCDF files with a virtual filesystem:
Notable exceptions are the netCDF, HDF4 and HDF5 drivers.
So unfortunately it seems like downloading the file to disk might be unavoidable (I’m not sure if one of xarray’s open_dataset
engines would be able to read this file over the network).