Setting Environment Variables In Google Cloud Platform Using Cloud Functions
I'm following the guide here and can't seem to get my Python app (which is deployed fine on GCP) to read the environment variables I've created in Cloud Functions. The REST endpoin
Solution 1:
I have been struggling with this for some time. The only solution I have found to set environment variables for the whole app is to define them in app.yaml
. See the env_variables section here.
But then you cannot commit app.yaml
to any version control repository if you don't want people to see the environment variables. You could add it to .gitignore
. There are more secure ways to handle secrets storage if these variables contain sensitive data. If you need more robust security, you might find some inspiration here.
Post a Comment for "Setting Environment Variables In Google Cloud Platform Using Cloud Functions"