# Context env vars not being picked up inside commands

**URL:** <https://discuss.circleci.com/t/context-env-vars-not-being-picked-up-inside-commands/40459>\
**Category:** Build Environment\
**Tags:** circle-yml\
**Created:** [June 25, 2021, 10:37am UTC](https://discuss.circleci.com/t/context-env-vars-not-being-picked-up-inside-commands/40459 "2021-06-25T10:37:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lp-2233](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/lp-2233/32/27681_2.png) [@lp-2233](https://discuss.circleci.com/u/lp-2233)\
**Post date:** [June 25, 2021, 10:37am UTC](https://discuss.circleci.com/t/context-env-vars-not-being-picked-up-inside-commands/40459/1 "2021-06-25T10:37:30Z")

</div>

According to the docs you should specify what contexts you want to use at Workflow level, which makes sense, so lets assume I have something like this:

```auto
version: 2.1

commands:    
  build:
    description: Does an NPM build
    steps:
      - run: env
      - run: npm run build

executors:
  node-executor:
    docker:
      - image: circleci/node:12.14.1

jobs:
  build-app:
    executor: node-executor
    environment:
      TZ: 'Europe/London'
    steps:
      - build

workflows:
  version: 2
  build_stuff:
    jobs:      
      - build-app:
          context:
            - MyContext

```

So in this case I would expect the environmental vars that are in `MyContext` to be passed into the job `build-app` which in turn calls `build` command, and we are seeing that in SSH the context environmental vars have been set, but when we run the comman (`build`) they are no longer available.

So do you need to do anything else to have commands take the env vars from the job thats calling them?

---

<div class="post-metadata">

**Author:** ![thekatertot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thekatertot/32/25169_2.png) [@thekatertot](https://discuss.circleci.com/u/thekatertot)\
**Post date:** [July 12, 2021, 11:17pm UTC](https://discuss.circleci.com/t/context-env-vars-not-being-picked-up-inside-commands/40459/2 "2021-07-12T23:17:37Z")

</div>

This example you have looks correct. If the command doesn’t read the env var, my guess would be that it’s the command that’s set up incorrectly instead of the env var.
