Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECMWF realtime data are not available from Microsoft's Azure: "https://ai4edataeuwest.blob.core.windows.net/ecmwf" #395

Open
Cong-Lee opened this issue Dec 23, 2024 · 6 comments · May be fixed by #397
Labels
ECMWF Issues with access to ECMWF open data files help wanted Extra attention is needed

Comments

@Cong-Lee
Copy link

see below for access notes:
Microsoft Azure has recently changed the anonymous access function to ECMWF open data. Users can still access the data anonymously but they must request a short-lived SAS token.

please update your herbie, thanks!

@blaylockbk
Copy link
Owner

Can you provide more details about this change? I haven't heard about it. I'm not sure what a SAS token is.

@blaylockbk
Copy link
Owner

Found this

https://confluence.ecmwf.int/plugins/servlet/mobile?contentId=272310539#content/view/272310539

Which points to this...
https://planetarycomputer.microsoft.com/docs/concepts/sas/

Not sure yet how to implement this in Herbie right now. Sounds like we will need to depend on the planetary-computer python package. This is annoying.

Anyone out there have suggestions?

@blaylockbk blaylockbk added help wanted Extra attention is needed ECMWF Issues with access to ECMWF open data files labels Dec 23, 2024
@blaylockbk
Copy link
Owner

Actually, maybe we just need to make a call to the token endpoint to the file we are trying to download.

Maybe if azure is in Herbie source priority list, get a token even if we don't need it. Or, only get a token when a file is requested from azure. Not sure what to do yet.

@blaylockbk
Copy link
Owner

I looks to me that this policy change is only affecting ECMWF forecasts right now. Let me know if anyone sees any others.

@blaylockbk blaylockbk linked a pull request Dec 24, 2024 that will close this issue
@blaylockbk
Copy link
Owner

Created a pull request with a quick and hacky fix. Needs some testing to find any issues and edge cases.

@Cong-Lee
Copy link
Author

Cong-Lee commented Feb 7, 2025

Each time you download data or an index, you can obtain the complete access URL via https://planetarycomputer.microsoft.com/api/sas/v1/sign?href={url}.
For example, in the following example:

import requests

download_url = "https://planetarycomputer.microsoft.com/api/sas/v1/sign?href=https://ai4edataeuwest.blob.core.windows.net/ecmwf/20250202/12z/ifs/0p25/oper/20250202120000-0h-oper-fc.grib2"
response = requests.get(download_url)
download_url_with_sas_token = response.json()["href"]
print(download_url_with_sas_token)

This will give you the complete download URL with the SAS token appended.

Frequent token retrieval may be subject to rate limits, so it is advisable to further implement a token caching mechanism.

There is another significant issue here. At certain points in time, when downloading data from Azure, an error occurs. The error is as follows:

BlobNotFound
The specified blob does not exist. RequestId:e07361b2-701e-0012-2d25-79623d000000 Time:2025-02-07T05:58:01.1142026Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECMWF Issues with access to ECMWF open data files help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants