1
votes

I'm migrating a Firebase Function to Cloud Run. Everything is working as expected so far, including the Firebase Hosting link (which is great!). I'm just not sure how I should read the environment variables I've configured for this project (via https://firebase.google.com/docs/functions/config-env).

1
What values are you particularly interested in? - Steren
I’m interested in custom values that I set myself — eg. the API key for a web service that I’m talking to. I don’t know how much integration with Firebase is planned, but since Cloud Run works with Firebase Hosting, a way to share runtime config would be useful to folks like me who’d like to use both Functions & Run (or migrate from one to the other) within the same project. - mhuebert

1 Answers

2
votes

You'll have to find a different way to configure Cloud Run. You won't be able to access your environment variables set for Cloud Functions when deployed with the Firebase CLI. Those variables are only accessible for code running in Cloud Functions that uses the "firebase-functions" module.

Instead, you should set your Cloud Run environment with gcloud as documented here.