I'm trying to create a VM list out of active choice parameter:
def command = 'az vm list --resource-group test-test-test \
--query '[].{computerName:osProfile.computerName}' \
--output tsv'
def proc = command.execute()
proc.waitFor()
def output = proc.in.text
def exitcode= proc.exitValue()
def error = proc.err.text
if (error) {
println "Std Err: ${error}"
println "Process exit code: ${exitcode}"
return exitcode
}
//println output.split()
return output.split()
How am I supposed to write the groovy script inside the Active choice parameter in Jenkins? I just want to fetch all azure VMS in a list and send them to active choice parameter. One more question does the active choice paramter authenticate only on master? Can it authenticate on a node that has the AZ binary