Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - task: AzureCLI@1
- displayName: 'Setup Authentication'
- inputs:
- azureSubscription: '$(SUBSCRIPTION_NAME)'
- addSpnToEnvironment: true
- scriptLocation: inlineScript
- failOnStandardError: 'true'
- inlineScript: |
- echo "##vso[task.setvariable variable=ARM_SUBSCRIPTION_ID]$(az account show --query="id" -o tsv)"
- echo "##vso[task.setvariable variable=ARM_CLIENT_ID]${servicePrincipalId}"
- echo "##vso[task.setvariable variable=ARM_CLIENT_SECRET]${servicePrincipalKey}"
- echo "##vso[task.setvariable variable=ARM_TENANT_ID]$(az account show --query="tenantId" -o tsv)"
- echo "##vso[task.setvariable variable=ARM_ACCESS_KEY]$(az storage account keys list -n ${STORAGE_ACCOUNT} --query="[0].value" -o tsv
- - script: |
- export TF_IN_AUTOMATION=true
- export TF_VAR_subscription_id="$(ARM_SUBSCRIPTION_ID)"
- export TF_VAR_client_id="$(ARM_CLIENT_ID)"
- export TF_VAR_client_secret="$(ARM_CLIENT_SECRET)"
- export TF_VAR_tenant_id="$(ARM_TENANT_ID)"
- export TF_VAR_vm_username="$(vm_username)"
- export TF_VAR_vm_password="$(vm_password)"
- terraform init -no-color -input=false
- terraform plan -out=tfplan -no-color -input=false
- displayName: 'Terraform Plan'
- workingDirectory: '$(TFPATH)'
- enabled: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement