# Balena.yml not propagating env variables to fleet

**URL:** <https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246>\
**Category:** balenaOS\
**Created:** [March 26, 2023, 8:25pm UTC](https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246 "2023-03-26T20:25:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luandro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/luandro/32/6867_2.png) [@luandro](https://forums.balena.io/u/luandro)\
**Post date:** [March 26, 2023, 8:25pm UTC](https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246/1 "2023-03-26T20:25:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![shawaj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shawaj/32/8203_2.png) [@shawaj](https://forums.balena.io/u/shawaj)\
**Post date:** [March 26, 2023, 9:52pm UTC](https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246/2 "2023-03-26T21:52:20Z")

</div>

From my experience of using Balena, it only pulls in when you use the [“deploy with Balena” button](https://docs.balena.io/learn/deploy/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](https://hub.balena.io)

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”

 ![Screenshot_20230324_132456_Chrome](https://global.discourse-cdn.com/balena/original/2X/2/2d30192a64f7a1a69fff641f762b1e944cf970d3.jpeg)

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

 ![Screenshot_20230324_132522_Chrome](https://global.discourse-cdn.com/balena/original/2X/e/e900a65984d3ae49bfc11d1ed87b7e489750ff8b.jpeg)

You can see an example in this repo…

> **[GitHub - NebraLtd/helium-syncrobit: Nebra OpenFleet for Syncrobit CM4 Miners](https://github.com/NebraLtd/helium-syncrobit)**
>
> Nebra OpenFleet for Syncrobit CM4 Miners. Contribute to NebraLtd/helium-syncrobit development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [March 28, 2023, 2:13pm UTC](https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246/5 "2023-03-28T14:13:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SamEureka](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sameureka/32/7616_2.png) [@SamEureka](https://forums.balena.io/u/SamEureka)\
**Post date:** [March 29, 2023, 10:32pm UTC](https://forums.balena.io/t/balena-yml-not-propagating-env-variables-to-fleet/367246/6 "2023-03-29T22:32:53Z")

</div>

@luandro In my balenaRancher project I create some fleet variables with this [script](https://github.com/SamEureka/balenaRancher/blob/96f3f3134dc5937052dde75d4811fbfcba933fdd/rancher/token-wrangler.py). 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.

> **[GitHub - SamEureka/balenaRancher: Create a Raspberry Pi4 based kubernetes...](https://github.com/SamEureka/balenaRancher)**
>
> Create a Raspberry Pi4 based kubernetes cluster with Rancher and k3s, in a balenaCloud fleet! - GitHub - SamEureka/balenaRancher: Create a Raspberry Pi4 based kubernetes cluster with Rancher and k3...
