I am trying to follow the below link to deploy an App Service using Terraform via Azure Dev Ops Pipeline
I have disabled Terraform Init and enabled debugging. But it still fails at Terraform Apply and i see the below logs. The task never finishes
Terraform Apply Task
Exit code 0 received from tool 'C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe'
STDIO streams have closed for tool 'C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe'
provider=azurerm
commandOptions=-auto-approve
workingDirectory=C:\hostedtoolcache\windows\terraform
environmentServiceNameAzureRM=a8ee372e-0734-4e50-aa5a-e19d9e5f2a62
which 'terraform'
found: 'C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe'
which 'C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe'
found: 'C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe'
C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe arg: apply
C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe arg: -auto-approve
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 auth param serviceprincipalid = ***
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 auth param serviceprincipalkey = ***
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 data subscriptionid = xxxx-xxxx-xxxx
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 auth param tenantid = xxxx-xxxxxx
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 auth param serviceprincipalid = ***
a8ee372e-0734-4e50-aa5a-e19d9e5f2a62 auth param serviceprincipalkey = ***
exec tool: C:\hostedtoolcache\windows\terraform\1.1.5\x64\terraform.exe
arguments:
CodePudding user response:
When running Terraform from within a non-interactive pipeline you must add the flag -input=false
, otherwise Terraform will hang expecting user input.
See documentation here: https://www.terraform.io/cli/commands/plan#input-false