title: How to reference a variable in Terraform file for Azure DevOps/VSTS
body: <p>I have created a simple pipeline. A Github repo with Azure DevOps <strong>Build</strong> pipeline.</p>
  
  <p>I have defined the below mentioned variables in ax.tf file which is in Github private repository:</p>
  
  <pre><code>ARM_CLIENT_ID
  ARM_CLIENT_SECRET
  ARM_SUBSCRIPTION_ID
  ARM_TENANT_ID
  </code></pre>
  
  <p>Build pipeline has a simple Command line Job which is as below:</p>
  
  <pre><code>sudo apt install wget
  
  wget https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip
  
  sudo apt-get install unzip
  
  unzip terraform_0.11.11_linux_amd64.zip
  
  terraform init
  
  terraform plan -var-file=terraform.tfvars -out=ax.plan
  
  terraform apply ax.plan
  
  terraform destroy -auto-approve
  </code></pre>
  
  <p>I want to know how to reference these Build variables in Terraform ax.tf file?</p>
  
  <p>I have done something like below as per Azure DevOps documentation but it is not working:</p>
  
  <pre><code>variable "ARM_SUBSCRIPTION_ID" {
      default="$(Build.ARM_SUBSCRIPTION_ID)"
  }
  </code></pre>
  
  <p>Unfortunately, it's not working as expected and it stops at the below execution level:</p>
  
  <pre><code>[0m[1m[32mTerraform has been successfully initialized![0m[32m[0m
  [0m[32m
  You may now begin working with Terraform. Try running "terraform plan" to see
  any changes that are required for your infrastructure. All Terraform commands
  should now work.
  If you ever set or change modules or backend configuration for Terraform,
  rerun this command to reinitialize your working directory. If you forget, other
  commands will detect it and remind you to do so if necessary.[0m
  [0m[1mvar.ARM_CLIENT_ID[0m
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thank you.</p>