microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
95 stars 59 forks source link

Can we Authenticate using Service principle and Certificate instead of service connection in terraform task #200

Open sudhir-ops opened 7 months ago

sudhir-ops commented 7 months ago

Can we Authenticate using Service principle and Certificate instead of service connection in terraform task

The below link says we can do it through PowerShell command. But is it possible in terraform task in azure pipeline. https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_certificate

image
jaredfholgate commented 7 months ago

Hi @sudhir-ops. If you don't want to use Service Connection authentication (why wouldn't you?), then you don't need the task. Just use the Terraform CLI directly and supply the env vars. You can still use the task to install terraform, but you don't need it for init, plan or apply if not using a service connection.