Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (43 sloc) 4.54 KB
title description ms.topic ms.prod ms.technology ms.assetid ms.manager ms.author author ms.date monikerRange
Build Machine Image task
Build a machine image using Packer to use for Azure Virtual machine scale set deployment
reference
devops
devops-cicd
845fd4f4-642d-4694-8514-047948a5a556
jillfra
ronai
RoopeshNair
12/07/2018
azure-devops

Build Machine Image task

Azure Pipelines

Use this task in a build or release pipeline to build a machine image using Packer. This image can be used for Azure Virtual machine scale set deployment.

::: moniker range="> tfs-2018"

YAML snippet

[!INCLUDE temp]

::: moniker-end

Arguments

[!INCLUDE temp]

ArgumentDescription
Packer template(Required) Select whether you want the task to auto generate Packer template or use custom template provided by you.
Packer template location(Required) Path to a custom user-provided template.
Template parameters(Optional) Specify parameters which will be passed to Packer for building custom template. This should map to "variables" section in your custom template. E.g. if the template has a variable named "drop-location", then add a parameter here with name "drop-location" and a value which you want to use. You can link the value to a release variable as well. To view/edit the additional parameters in a grid, click on "…" next to text box.
Azure subscription(Required) Select the Azure Resource Manager subscription for baking and storing the machine image.
Storage location(Required) Location for storing the built machine image. This location will also be used to create a temporary VM for the purpose of building image.
Storage account(Required) Storage account for storing the built machine image. This storage account must be pre-existing in the location selected.
Resource group(Required) Azure Resource group that contains the selected storage account.
Base image source(Required) Select the source of base image. You can either choose from a curated gallery of OS images or provide url of your custom image.
Base image(Required) Choose from curated list of OS images. This will be used for installing pre-requisite(s) and application(s) before capturing machine image.
Base image URL(Required) Specify url of base image. This will be used for installing pre-requisite(s) and application(s) before capturing machine image.
Base image OS(Required) undefined
Deployment Package(Required) Specify the path for deployment package directory relative to $(System.DefaultWorkingDirectory). Supports minimatch pattern. Example path: FrontendWebApp//GalleryApp
Deployment script(Required) Specify the relative path to powershell script(for Windows) or shell script(for Linux) which deploys the package. This script should be contained in the package path selected above. Supports minimatch pattern. Example path: deploy//scripts/windows/deploy.ps1
Deployment script arguments(Optional) Specify the arguments to be passed to deployment script.
Additional Builder parameters(Optional) In auto generated Packer template mode the task creates a Packer template with an Azure builder. This builder is used to generate a machine image. You can add keys to the Azure builder to customize the generated Packer template. For example setting ssh_tty=true in case you are using a CentOS base image and you need to have a tty to run sudo.
To view/edit the additional parameters in a grid, click on “…” next to text box.
Skip temporary file cleanup during deprovision(Optional) During deprovisioning of VM, skip clean-up of temporary files uploaded to VM. Refer here
Image URL(Optional) Provide a name for the output variable which will store generated machine image url.

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

You can’t perform that action at this time.