magnusrodseth_16480
Authenticating Railway deployment to Google Cloud Platform (GCP)
I have a simple Express server that needs to access one of GCP's client libraries, namely Document AI. Everything works as intended locally, as I successfully load environment variables and authenticate for local development by following this guide: https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev.
However, when deploying the changes that work locally, my request to the server is stuck in an eternal loading state. I suspect this is because the Railway deployment is not authenticated for GCP Application Default Credentials (https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to).
I have verified that my environment variables are loaded correctly in the production environment, so it must be something else causing the error.
Some relevant documentation I have read through:
- Document AI client libraries: https://cloud.google.com/document-ai/docs/libraries
- How to provide credentials to ADC: https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to
- Authenticate for using client libraries: https://cloud.google.com/docs/authentication/client-libraries
How can I authenticate my Railway deployment for using GCP client libraries?
6 replies