# Inject vault secrets as environment variables

**URL:** <https://community.temporal.io/t/inject-vault-secrets-as-environment-variables/11241>\
**Category:** Community Support\
**Created:** [March 5, 2024, 2:39am UTC](https://community.temporal.io/t/inject-vault-secrets-as-environment-variables/11241 "2024-03-05T02:39:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![azuan](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@azuan](https://community.temporal.io/u/azuan)\
**Post date:** [March 5, 2024, 2:39am UTC](https://community.temporal.io/t/inject-vault-secrets-as-environment-variables/11241/1 "2024-03-05T02:39:47Z")

</div>

Assuming that I’m using vault injection to generate the username/password, is there a way to pass the values as a secret variable to the pods?

```auto
annotations:
  # Environment variable export template
  vault.hashicorp.com/agent-inject-template-temporal-db-creds.sh: |
    {{ with secret "db/creds/data" -}}
      export SQL_USER="{{ .Data.user.user }}"
      export SQL_PWD="{{ .Data.user.pwd }}"
    {{- end }}

```

```auto
# pod
spec:
  initContainers:
    name: 'temporal
      command: ['/bin/bash', '-c']
      args:
        - |
          source /vault/secrets/temporal-db-creds.sh
          temporal-{{ include "temporal.persistence.sql.driver" (list $ $store) }}-tool --database {{ include "temporal.persistence.sql.database" (list $ $store) }} create-database

```

This is my current approach, but would get an error:  
`/bin/bash: line 2: temporal-mysql-tool: command not found`

---

<div class="post-metadata">

**Author:** ![azuan](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@azuan](https://community.temporal.io/u/azuan)\
**Post date:** [March 7, 2024, 4:35pm UTC](https://community.temporal.io/t/inject-vault-secrets-as-environment-variables/11241/2 "2024-03-07T16:35:41Z")

</div>

My bad. Should be `temporal-sql-tool`, not `temporal-mysql-tool`.
