# Resin env add adding service variable rather than device-wide -\> is this by design?

**URL:** <https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735>\
**Category:** Product support\
**Tags:** resin-cli\
**Created:** [August 14, 2018, 4:52pm UTC](https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735 "2018-08-14T16:52:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [August 14, 2018, 4:52pm UTC](https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735/1 "2018-08-14T16:52:52Z")

</div>

If I call the below against a multi-container device it ends up adding as a service variable rather than device-wide.  
Is this by design and am I missing something?

resin env add --device $uuid something something

I did not find an obvious parameter to set against a specific service, which would also be fine.  
[https://docs.resin.io/reference/cli/#config-read](https://docs.resin.io/reference/cli/#config-read)

---

<div class="post-metadata">

**Author:** ![CameronDiver](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@CameronDiver](https://forums.balena.io/u/CameronDiver)\
**Post date:** [August 14, 2018, 5:50pm UTC](https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735/4 "2018-08-14T17:50:22Z")

</div>

@WillFG currently the CLI does not support assigning environment variables to services just yet. You can track this progress of this here: [https://github.com/resin-io/resin-cli/issues/855](https://github.com/resin-io/resin-cli/issues/855)

Alternatively, you can use our SDK to do this, using the method documented here: [https://github.com/resin-io/resin-sdk/blob/master/DOCUMENTATION.md#resin.models.service.var.set](https://github.com/resin-io/resin-sdk/blob/master/DOCUMENTATION.md#resin.models.service.var.set)

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [August 15, 2018, 8:30am UTC](https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735/6 "2018-08-15T08:30:06Z")

</div>

Hi Cameron, sorry my question probably was not clear.

The issue I am having is that it _is_ assigning it to a service rather than device wide, which is what I want.

From issue 855 it sounds like it has not been nailed down quite for multi-container apps, so I expect this is a side effect of that.

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [October 1, 2018, 1:57pm UTC](https://forums.balena.io/t/resin-env-add-adding-service-variable-rather-than-device-wide-is-this-by-design/3735/8 "2018-10-01T13:57:30Z")

</div>

@CameronDiver I’ve just read the CLI documentation again and it is indeed mentioned: “At the moment the CLI doesn’t fully support multi-container applications, so the following commands will only set service variables for the first service in your application.” so that clears it up.
