I have a Cloud Function in GCP that queries BigQuery in a specific project/environment. As I have multiple environments I would like to get the current project/environment of the cloud function. This is so that I can access BigQuery in the corresponding environment. Of course I could just hardcode the project_id, but I would like to do this programmatically.
According to Google environment variables are set automatically. But when I try to access those I cannot find any of them.
For instance I have tried the following, which gives me none of the env. var listed by Google.
print(os.environ)
Anyone managed to access environment variables at runtime?