[Issue] Azd down --no-prompt hangs in pipeline and does not initialise terraform #4317
Open
1 task done
Labels
customer-reported
identify a customer issue
needs-team-attention
Issues out of a milestone
question
terraform
Milestone
Output from
azd version
azd version 1.10.1 (commit 31409a3)
Describe the bug
I am trying to setup a pipeline to tear down environments. I use Terraform as the backend. I want to be able to run
azd down --preview
but that option isn't available, however it looks likeazd down
prompts for confirmation by default, so it looks like I should be able to get a preview of the Terraform destroy by runningazd down --no-prompt
which i'd expect it to show the Terraform destroy plan and then stop execution because the default confirmation would be not to continue, however the pipeline task just hangs. The only way to get destroy to run in the pipeline is to useazd down --no-prompt --force
. There's no way to preview the changes first.Additionally
azd down
does not perform aterraform init
, so running it on its own in a pipeline just throws an error "backend initialization required". I can workaround this by runningazd provision --preview
first but it would be nice not to have to.To Reproduce
Setup an Azure DevOps pipeline task to run
azd down --no-prompt
. The task will hang.Expected behavior
azd down --no-prompt
= Should output the Terraform destroy plan and then the task should exit with no error, as if the confirmation prompt was answered with "no".Alternatively implement an
azd down --preview
that when Terraform is the backend performsterraform destroy -plan
.Either should also perform a terraform init so that you don't have to unnecessarily (and confusingly) run
azd provision --preview
(unless there's some better alternative I'm missing here).Environment
Azure DevOps pipeline self hosted agent running unbuntu.
Azd tasks run as Bash.
Additional context
None
The text was updated successfully, but these errors were encountered: