Giter VIP home page Giter VIP logo

packer-windows-avd's Introduction

packer-windows-avd

Custom Windows 11 "golden" image for Azure Virtual Desktop (AVD) built with Packer.

It bundles apps that make the image suitable for software development workstations using Chocolatey and a PowerShell provisioning script.

A GitHub Actions workflow checks daily for a new Windows release and runs Packer if required (typically on Patch Tuesday).

Deploy Terraform Resources

I like using Terraform to pre-provision the resources required by Packer. However, you can use the Azure Portal or similar alternatively.

Authenticate with Terraform:

The packer.tf file contains the following resources:

  • Two resource groups
    • packer-artifacts-rg: managed images produced by Packer
    • packer-build-rg: build-time Packer resources. It should be empty when Packer isn't running
  • Service Principal with scoped Contributor access to Packer resource groups, and Reader access to subscription
  • GitHub secrets required for GitHub Actions workflow

Run terraform apply to deploy the required resources.

Run Packer Locally

After deploying the resources with Terraform, run the following command to run Packer (note the . at the very end):

packer build \
  -var "artifacts_resource_group=$(terraform output -raw packer_artifacts_resource_group)" \
  -var "build_resource_group=$(terraform output -raw packer_build_resource_group)" \
  -var "client_id=$(terraform output -raw packer_client_id)" \
  -var "client_secret=$(terraform output -raw packer_client_secret)" \
  -var "subscription_id=$(terraform output -raw packer_subscription_id)" \
  -var "tenant_id=$(terraform output -raw packer_tenant_id)" \
  -var "source_image_publisher=MicrosoftWindowsDesktop" \
  -var "source_image_offer=office-365" \
  -var "source_image_sku=win11-21h2-avd-m365" \
  -var "source_image_version=22000.556.220308" \
  .

Discover Windows 11 Versions

Use the Azure CLI to discover what versions are available.

With Office

List SKUs:

az vm image list-skus \
  --offer office-365 \
  --publisher MicrosoftWindowsDesktop \
  --query "[*].name" \
  --out tsv

List versions:

az vm image list \
  --sku win11-21h2-avd-m365 \
  --offer office-365 \
  --publisher MicrosoftWindowsDesktop \
  --query "[*].version" \
  --out tsv \
  --all

Without Office

List SKUs:

az vm image list-skus \
  --offer windows-11 \
  --publisher MicrosoftWindowsDesktop \
  --query "[*].name" \
  --out tsv

List versions:

az vm image list \
  --sku win11-21h2-avd \
  --offer windows-11 \
  --publisher MicrosoftWindowsDesktop \
  --query "[*].version" \
  --out tsv \
  --all

packer-windows-avd's People

Contributors

schnerring avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.