# Kubernetes plugin command variables not expanding?

**URL:** <https://drone.discourse.group/t/kubernetes-plugin-command-variables-not-expanding/9552>\
**Category:** Drone Support\
**Created:** [March 26, 2021, 4:15pm UTC](https://drone.discourse.group/t/kubernetes-plugin-command-variables-not-expanding/9552 "2021-03-26T16:15:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric-Fontana-Tjx](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/eric-fontana-tjx/32/2929_2.png) [@Eric-Fontana-Tjx](https://drone.discourse.group/u/Eric-Fontana-Tjx)\
**Post date:** [March 26, 2021, 4:15pm UTC](https://drone.discourse.group/t/kubernetes-plugin-command-variables-not-expanding/9552/1 "2021-03-26T16:15:42Z")

</div>

I’m trying to use the Kubernetes plugin, my pipeline looks like this:

```
kind: pipeline
type: kubernetes
name: cluster-create

# new comment goes here

image_pull_secrets:
- image_pull_secret

steps:
- name: initialize
  image: xxxxxxx.azurecr.io/yyyyyyy/drone-terraform-azure/terraform-azure:main
  environment:
    STATE_STORAGE_ACCOUNT:
      from_secret: state-storage-account
    STATE_CONTAINER_NAME:
      from_secret: state-container-name
    STATE_ACCESS_KEY:
      from_secret: state-access-key
    SERVICE_PRINCIPAL_PASSWORD:
      from_secret: service-principal-password
  commands:
  - env|sort
  - az login --service-principal --username "ServicePrincipalTerraform" --password 
${SERVICE_PRINCIPAL_PASSWORD} --tenant my-tenant-id-here

```

But the command “az login” isn’t getting the service principal password expanded???

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [March 26, 2021, 4:28pm UTC](https://drone.discourse.group/t/kubernetes-plugin-command-variables-not-expanding/9552/2 "2021-03-26T16:28:41Z")

</div>

See [docs.drone.io/pipeline/environment/substitution/#escaping](https://docs.drone.io/pipeline/environment/substitution/#escaping)

---

<div class="post-metadata">

**Author:** ![Eric-Fontana-Tjx](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/eric-fontana-tjx/32/2929_2.png) [@Eric-Fontana-Tjx](https://drone.discourse.group/u/Eric-Fontana-Tjx)\
**Post date:** [March 27, 2021, 10:54am UTC](https://drone.discourse.group/t/kubernetes-plugin-command-variables-not-expanding/9552/3 "2021-03-27T10:54:02Z")

</div>

Well, I did read the escaping rules, turns out they don’t expand if you use the dollar-curly ${} syntax, you  
just use a dollar sign. When you read this doc: [Substitution | Drone](https://docs.drone.io/pipeline/environment/substitution/)  
Examples show `${DRONE_TAG} ` so I assumed that would work. It is documented,

> Also note the environment section cannot expand environment variables or evaluate shell expressions. If you need to construct variables it should be done in the commands section.
