Using env PC_SDK_SUBSCRIPTION_KEY token via planetary_computer library not working #182
-
I'm using the MSFT planetary computer in a (closed beta) production setting, where it is important to access data reliably and quickly. Our system is based in Europe West Azure. As per the documentation, the other thing I can do is set the PC_SDK_SUBSCRIPTION_KEY environment variable (or pass it myself via the request header, but the first seemed more elegant. This is an azure function python environment. I've set the environment variable, with the value to an API token created via my hub access (hub>tokens drop-down). I then run python code in this environment to query the stac catalogue, and ingest data via the DASK compute graph generated by stackstac. I do not pass the sign in place flag, I call the sign method on each item individually. This works, with and without env variable, nothing is logged differently as far as I can tell. Other environment variables are accessed correctly by my code. Unfortunately, it displays in the planetary computer token drop-down, that the last use of this token was never. Is there a way to check that the python library is sending/finding the token correctly? Is this the wrong token? I would also like to say, the experience so far has been amazing, and I'm very excited for the upcoming features, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This makes it sound like you created a JupyterHub token. For the SAS API, you would want a token from the "developer portal" at https://planetarycomputer.developer.azure-api.net/. See https://planetarycomputer.microsoft.com/docs/concepts/sas/#when-an-account-is-needed for more. Apologies for the confusion. Ideally you wouldn't need to worry about multiple tokens, but that's the system we have at the moment. |
Beta Was this translation helpful? Give feedback.
This makes it sound like you created a JupyterHub token.
For the SAS API, you would want a token from the "developer portal" at https://planetarycomputer.developer.azure-api.net/. See https://planetarycomputer.microsoft.com/docs/concepts/sas/#when-an-account-is-needed for more.
Apologies for the confusion. Ideally you wouldn't need to worry about multiple tokens, but that's the system we have at the moment.