Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. - task: AzureCLI@1
  2. displayName: 'Setup Authentication'
  3. inputs:
  4. azureSubscription: '$(SUBSCRIPTION_NAME)'
  5. addSpnToEnvironment: true
  6. scriptLocation: inlineScript
  7. failOnStandardError: 'true'
  8. inlineScript: |
  9. echo "##vso[task.setvariable variable=ARM_SUBSCRIPTION_ID]$(az account show --query="id" -o tsv)"
  10. echo "##vso[task.setvariable variable=ARM_CLIENT_ID]${servicePrincipalId}"
  11. echo "##vso[task.setvariable variable=ARM_CLIENT_SECRET]${servicePrincipalKey}"
  12. echo "##vso[task.setvariable variable=ARM_TENANT_ID]$(az account show --query="tenantId" -o tsv)"
  13. echo "##vso[task.setvariable variable=ARM_ACCESS_KEY]$(az storage account keys list -n ${STORAGE_ACCOUNT} --query="[0].value" -o tsv
  14. - script: |
  15. export TF_IN_AUTOMATION=true
  16. export TF_VAR_subscription_id="$(ARM_SUBSCRIPTION_ID)"
  17. export TF_VAR_client_id="$(ARM_CLIENT_ID)"
  18. export TF_VAR_client_secret="$(ARM_CLIENT_SECRET)"
  19. export TF_VAR_tenant_id="$(ARM_TENANT_ID)"
  20. export TF_VAR_vm_username="$(vm_username)"
  21. export TF_VAR_vm_password="$(vm_password)"
  22. terraform init -no-color -input=false
  23. terraform plan -out=tfplan -no-color -input=false
  24. displayName: 'Terraform Plan'
  25. workingDirectory: '$(TFPATH)'
  26. enabled: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement