Balena.yml not propagating env variables to fleet

From what I understood, balena.yml’s applicationEnvironmentVariables property should propagate to fleet’s default variables, is that correct?

If so, they aren’t propagating. Should default env variables for a fleet really be added manually?

From my experience of using Balena, it only pulls in when you use the “deploy with Balena” button.

Or using just the domain without the button in the structure https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/org/repo of course changing the org and repo to yours. Or you can deploy via balenaHub

But, you can also propogate those through from a github repo after updating the balena.yml in there by just using the button or URL structure above to access BalenaCloud and then selecting to “Use an existing fleet instead”

Then you can see the env variables by toggling the “Advanced” toggle…

You can see an example in this repo…

2 Likes

Hello, that field was created as a convenience method for defining fleet variables on first creation of the fleet. There is already a mechanism for defining variables tied to the release via the dockerfile and docker-compose and it’s unclear how we could make the applicationEnvironmentVariables change the fleet level env vars in a safe way. We understand the property is ambiguous and we are discussing internally how we can better enable the use case you describe in the future.

2 Likes

@luandro In my balenaRancher project I create some fleet variables with this script. Not sure if this is helpful but if you are looking to change/create Fleet Wide variables automagically, this works. You need an API key though, so be mindful of security.

1 Like