developmentseed / eoAPI

[Active Development] Earth Observation API (Metadata, Raster and Vector services)
https://eoapi.dev
MIT License
196 stars 21 forks source link

Accessing COGs from Azure Blob Storage #122

Closed charalamm closed 1 year ago

charalamm commented 1 year ago

Problem description

I have an azure blob storage account with the COG files and an eoapi raster runtime deployment. When anonymous read access is allowed on the blobs then everything works fine but when there is a requirement for credentials then the API returns 500.

To make the raster eoAPI work with the private blob storage I added the AZURE_STORAGE_CONNECTION_STRING environment variable but doesn't seem to solve the problem. At the same time I tried the following snippet on "production" and rasterio works with that environment variable.

import os
import rasterio

os.environ["AZURE_STORAGE_CONNECTION_STRING"] = "<>"

blob = "az://data/raster_file.tif"

with rasterio.open(blob, "r") as f:
    print(f.crs)

Environment Information

The raster runtime is deployed using the raster-uvicorn docker image as an azure container app. The rasterio version in the container is 1.3.8