hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.46k stars 4.54k forks source link

Docs says to use TerraformTaskV4@4 task but provides no details and pipeline editor says it does not exist #25638

Open mortenn opened 2 months ago

mortenn commented 2 months ago

Is there an existing issue for this?

Community Note

Terraform Version

latest in ubuntu image

AzureRM Provider Version

3.99.0

Affected Resource(s)/Data Source(s)

n/a

Terraform Configuration Files

n/a

Debug Output/Panic Output

n/a

Expected Behaviour

The docs should contain information about how to use the TerraformTaskV4@4 task or a link to documentation for the task

Actual Behaviour

The docs just says to use the task to easily connect, but the pipeline editor in devops claims the task does not exist

Steps to Reproduce

Open the docs at this url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_oidc#setting-up-an-application-and-service-principal-in-azure

Scroll down near the bottom, to the section "Azure DevOps Pipelines"

Read the sentence "Use the TerraformTaskV4@4 task to easily connect Terraform to Azure using your workload identity."

Important Factoids

No response

References

No response

liuwuliuyun commented 2 months ago

Hi @mortenn , thanks for raising this issue. You will need to install the extension to use TerraformTaskV4 or to install Terraform. You could login your account and install it from Visual Studio Market Place.

Setting up the Terraform extension in your Azure DevOps pipeline involves a few key steps. Here’s a simplified guide to get you started:

  1. Install the Terraform Extension:
    • Go to the Visual Studio Marketplace and find the Terraform extension.
    • Install it to your Azure DevOps organization.
  2. Create a Service Connection:
    • In Azure DevOps, navigate to ‘Project settings’ > ‘Service connections’.
    • Create a new service connection for Azure Resource Manager, providing the necessary permissions.
  3. Set Up a New Pipeline:
    • In your Azure DevOps project, go to ‘Pipelines’ > ‘New pipeline’.
    • Connect to the repository where your Terraform configuration files are stored.
  4. Define Your Pipeline YAML:
    • Use the YAML editor to define the pipeline stages, which will include Terraform commands like init, validate, plan, and apply.
    • Specify the Terraform version and the service connection to use.
  5. Run the Pipeline:
    • Save and run your pipeline to execute the Terraform code and deploy your infrastructure.
liuwuliuyun commented 2 months ago

You could raise issue in https://github.com/microsoft/azure-pipelines-terraform incase you encounter any problems using this extension

mortenn commented 2 months ago

Thanks for the clarification