简体   繁体   English

Azure DevOps 和 Terraform 扩展 - 调试

[英]Azure DevOps and Terraform Extension - Debug

Using a DevOps pipeline with the Terraform Azure extension from Peter Groenewegen 2.4.0 (Latest).使用来自 Peter Groenewegen 2.4.0(最新)的带有 Terraform Azure 扩展的 DevOps 管道。 My question is in regards to setting the TF_LOG=Debug global variable using this extension and troubleshooting in general.我的问题是关于使用此扩展设置 TF_LOG=Debug 全局变量和一般故障排除。 I'm getting a vague error message,, "##[error] Terraform failed to execute. Error:", and wanted to see the debug logs for troubleshooting but haven't been able to do this yet.我收到一条模糊的错误消息,“##[error] Terraform 无法执行。错误:”,并希望查看调试日志以进行故障排除,但还不能执行此操作。 I've tried using a separate task with an export TF_LOG=Debug or adding it to the global variables section, a tfvars file or right on the terraform apply command(##[command]"terraform" apply -auto-confirm -var 'TF_LOG=DEBUG' -input=false -no-color) with the -var TF_LOG=Debug switch.我尝试使用带有 export TF_LOG=Debug 的单独任务或将其添加到全局变量部分、tfvars 文件或 terraform 应用命令(##[command]"terraform" apply -auto-confirm -var ' TF_LOG=DEBUG' -input=false -no-color) 与 -var TF_LOG=Debug 开关。 How can I enable Debug using this extension?如何使用此扩展启用调试? Perhaps there is a better way to debug issues like this one?也许有更好的方法来调试像这样的问题? Thanks for any response.感谢您的任何回复。

Not sure if this will work for the task you're using, but it's worth a shot:不确定这是否适用于您正在使用的任务,但值得一试:

For the Microsoft terraform task for azure pipelines , this can be achieved by adding the TF_LOG variable to the pipeline with an appropriate value.对于azure 管道的 Microsoft terraform 任务,这可以通过将TF_LOG变量添加到具有适当值的管道来实现。 If you go your pipeline, then click 'Edit', then go to 'Variables' and add it like so:如果您使用 go 您的管道,然后单击“编辑”,然后单击 go 到“变量”并像这样添加它: Azure 管道变量概述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM