Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps

66 Views Asked by At
  1. I have a classic build pipeline

  2. I have defined a non-secret (var1), and a secret var (var2) in variables tab

  3. I have maven task that runs my java application

  4. I have tried to access the value of the variables through getenv, getProperty and ProcessBuilder approach.

  5. getenv and getProperty return null for both var1 and var2

  6. ProcessBuilder approach returns the value of var1 but var2 is still null

Is there a way to access the value of the secret variables inside java app?

Thank you.

0

There are 0 best solutions below