I want to run a pipeline i have with variables which are being sent from an application in a POST request to ADO pipeline. Trying to do something similar to this post with runs api: However I'm not sure how to reference these variables in my pipeline. I want to use terraform in my pipeline with some of these variables. This may be something simple I just have not found yet but any help is appreciated
I have searched online and some places say environment variables? Would appreciate help in how to reference these if thats the case.
To reference a pipeline variable assigned via the REST API Runs - Run Pipeline in terraform, you can refer to the following example. In this example, I create a new project and define the name of the project using the variable "projname".
projnameand refer to it usingvar.projnameinmain.tf.Add a variable named "projname" in the UI and leave its value empty.
Passs the value of
projnameto the terraform scripts using-var "projname=$(projname)"in your plan and apply command.If you are not making changes to DevOps org, there is no need to define
envvariables shown above.If you are using Terraform task, you can add
-var "projname=$(projname)"incommandOptions.Request body: