# How can use secret as env var?

**URL:** <https://community.okteto.com/t/how-can-use-secret-as-env-var/271>\
**Category:** How Do I?\
**Created:** [September 28, 2022, 11:35am UTC](https://community.okteto.com/t/how-can-use-secret-as-env-var/271 "2022-09-28T11:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mscarceller](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/mscarceller/32/166_2.png) [@mscarceller](https://community.okteto.com/u/mscarceller)\
**Post date:** [September 28, 2022, 11:35am UTC](https://community.okteto.com/t/how-can-use-secret-as-env-var/271/1 "2022-09-28T11:35:05Z")

</div>

Hi, im triying to use secrets as environment vars as follow:

```auto
        env:
          - name: MYSQL_ROOT_USERNAME
            value: ${DATABASE_USER}
          - name: MYSQL_ROOT_PASSWORD
            value: ${DATABASE_PASS}

```

where DATABASE\_USER and DATABASE\_PASS are Okteto Sectrets. And define my springboot app **application.properties** :

```auto
spring.datasource.username= ${MYSQL_ROOT_USERNAME}
spring.datasource.password= ${MYSQL_ROOT_PASSWORD}

```

It doesn’t work. 🙄

---

<div class="post-metadata">

**Author:** ![pchico83](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/pchico83/32/25_2.png) [@pchico83](https://community.okteto.com/u/pchico83)\
**Post date:** [September 28, 2022, 11:39am UTC](https://community.okteto.com/t/how-can-use-secret-as-env-var/271/2 "2022-09-28T11:39:46Z")

</div>

Hi @mscarceller  
Okteto doesn’t apply environment substitution to your okteto manifests. You will need to do that as part of your okteto deploy commands.  
Using a template ystem like helm or kustomize might also work
