I am porting a golang service from App Engine standard environment to the flexible environment, and have a question about accessing app.yaml during development/testing.
In my app.yaml I have a section where I set environment variables, that I later access in the code via os.GetEnv(...):
env_variables:
FORGE_CLIENT_ID: 'my-client-id'
FORGE_CLIENT_SECRET: 'my-client-secret'
In the App Engine standard environment, this runs fine, as I am using the app engine development server dev-server.py
, which I believe takes care of reading the app.yaml file and making these environment variables available.
However, in the flexible environment during development, the service is started simply with go run *.go
, and the app doesn't seem to pick up any information in app.yaml, meaning I get an error that my environment variables are not set.
I understand that app.yaml is used during deployment in the flexible environment, but I don't understand how or if it is used during development. How do I access these environment variables from my development server?
Thanks.