2

I would like to understand how the tasks work in Azure pipeline, and where can I find the documentation for it.

I have a self-hosted agent where I have installed Terraform, Azure CLI and Azure Powershell.

There are some tasks defined for them, I actually have difficulties to find them in a documentation,for example with terraform, I have to go to azure release and simulate an action of adding task, then convert that in yaml and there I have the task name:

steps:
- task: ms-devlabs.custom-terraform-tasks.custom-terraform-release-task.TerraformTaskV3@3
  displayName: 'Terraform : azurerm'
  inputs:
    command: custom
    customCommand: import
    environmentServiceNameAzureRM: 'something'

Also, some tasks asks to install some resources in order to use them, will it affect the resources of my self-hosted agent? for example if we have to install the task before using it ,will it affect somehow the version of my self-hosted terraform?

I have azure powershell installed in the self-hosted agent with an old version, but there is a task that in the version parameter has the latest version, but when executing the task it uses my old version.

How versions for tasks work? Can I use the latest version or az cli without installing it in the self-hosted agent but only with the tasks for the deployments only?

  - task: AzurePowerShell@5
    displayName: 'DevCode'
    inputs:
      #azureSubscription: 'something'
      azureSubscription: 'something'
      ScriptPath: 'something'
      azurePowerShellVersion: LatestVersion

The same for az cli.

Elias Arellano
  • 433
  • 5
  • 16

1 Answers1

0

For the commonly used pipeline tasks published by Microsoft (such as Azure CLI task and Azure PowerShell task), you can find the related documents here.

All these tasks are open-source on the GitHub repository "microsoft/azure-pipelines-tasks".

For the Terraform task, you can find it on Marketplace here and this GitHub repository.

Normally, the tasks would not change the tools have installed on your self-hosted agent machine, also not automatically install the required tools. They just call the required tools have installed on the agent machine.

For example, when you run the Azure CLI task on your self-hosted agent, if you have installed the Azure CLI tool on the agent machine, the task will call the tool to run the specified scripts. If the Azure CLI tool has not installed on the machine, normally the task will go to failure since it cannot find the required Azure CLI tool on the machine.

You do not need to manage the versions of the tasks, you just use the tasks in your pipelines and select the available released versions of the tasks (latest versions are recommended). If a new version of a task is released, you can go to edit your pipelines to use the new version.

Bright Ran-MSFT
  • 5,190
  • 1
  • 5
  • 12
  • This doesn't answer the question *How to manage versions of the tasks?* – Jeremy Thompson Jul 14 '22 at 06:20
  • Hi @JeremyThompson, See my complete answer. – Bright Ran-MSFT Jul 14 '22 at 06:42
  • Hi @EliasArellano, I have not heard from you for a long time. Just want to say hi and whether you have received my answer? Are the explanations in my answer helpful for you? As explained, you do not need to manage the versions of the tasks, you just use the tasks in your pipelines and select the available released versions of the tasks (latest versions are recommended). – Bright Ran-MSFT Jul 27 '22 at 07:11
  • This does nothing to answer the question. – Godwin Jun 06 '23 at 20:04