Referencing Service Variables in Shared Variables

malle
FREEOP

a year ago

I want to manage all my variables within the project scope, but when referencing a Service Variable in a Shared Variable, another service cannot access this Shared Variable.

I know it will work if I reference the Variable directly from service to service, but shouldn't my approach work as well?

6 Replies

a year ago

Can you give me an example of how you are using the variables?


malle
FREEOP

a year ago

Shared Variables:

  • DATABASE_URL=${{Database-Service.DATABASE_URL}}

Database-Service:

  • DATABASE_URL=postgresql://postgres:example@Database-Service.railway.internal:5432/railway

Web-Service:

  • DATABASE_URL=${{shared.DATABASE_URL}}

Background-Worker-Service:

  • DATBASE_URL=${{shared.DATABASE_URL}}

In this example the Web-Service and Background-Worker-Service would have an <empty string> as their DATABASE_URL. To be clear this is not a critical issue, it would just be nice to also have referenced variables in the shared variables to manage them in one place.


a year ago

Okay I acknowledge the issue, I will create a ticket for this.


malle
FREEOP

a year ago

Ok, thanks!


Anonymous
PRO

12 days ago

yeah I'm running into this too, has this still not been fixed?


12 days ago

We have not seen a significant enough need for this feature, so adding support for it has not been prioritized at this time.


Loading...
Referencing Service Variables in Shared Variables - Railway Help Station