Skip to content

Instantly share code, notes, and snippets.

@weeyin83
Created February 12, 2025 16:59
Show Gist options
  • Save weeyin83/a94a7c71d2f7e8618fcc6f0b0bff7e63 to your computer and use it in GitHub Desktop.
Save weeyin83/a94a7c71d2f7e8618fcc6f0b0bff7e63 to your computer and use it in GitHub Desktop.
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: AzureCLI@2
name: RunTerraform
inputs:
azureSubscription: INSERT NAME OF YOUR SERVICE CONNECTION # The name of your service connection goes here
scriptType: bash
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
export ARM_TENANT_ID="$tenantId"
export ARM_CLIENT_ID="$servicePrincipalId"
export ARM_OIDC_TOKEN="$idToken"
terraform init
terraform apply -auto-approve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment