1

I don't know if there's a way to use previously defined variables in variable definition. Basically I want to do something like this:

variables:
- name: basePath
  value: \\somepath
- name: servicePath
  value: $(basePath)\servicePath
- name: backupPath
  value: $(basePath)\backups

The later variables don't recognize basePath. Is there a different syntax I can use?

1 Answer 1

2

We do something similar, here's what we have in our yaml:

  - name: cdn-base
    value: 'https://cdn-name.azureedge.net'
  - name: 'CDN_URL'
    value: '$(cdn-base)/$(site-name)-$(environment)/'
  - name: NODE_MODULES_CACHE_FOLDER
    value: $(System.DefaultWorkingDirectory)/node_modules

Might just need to wrap your strings in quotes. Also check your agent type because it might be you using windows path separator on a linux agent.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I'll give it a try. I'm using a self-hosted Windows agent
Thanks a lot! It actually works!
You're very welcome, glad I could help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.