Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 2.91 KB

File metadata and controls

76 lines (54 loc) · 2.91 KB

Quick guide for the customized image

This is the quick guide about how to geneate the customized image for Dev Box. The main steps are as below:

  • Create a Gallery
  • Configure for Gallery
  • Create Service Principal
  • Generate the image

Create a Gallery

  1. Search "Azure Compute Galleries" in the Azure Portal, click the service "Azure compute galleries" Search Gallery

  2. Click the "Create" button Create Gallery

  3. Give the gallery name and select the resource group, then click "Review + Create" Create Gallery Detail

Configure for Gallery

  1. Fork the base repository Azure/dev-box-images Fork Base repo

  2. In your forked repository, change the value in gallery.yml:

name: "the gallery name that we just created in the above step" resourceGroup: "the resource group that the gallery is located"

Please check the mapping as below: Update Gallery Yml

Create Service Principal

  1. Create a Service Principal with the Azure CLI command as below:

az ad sp create-for-rbac --sdk-auth --role contributor --scopes /subscriptions/ -n

You will get the output as below: { "clientId": "", "clientSecret": "", "subscriptionId": "", "tenantId": "" (...) }

Remove all the line breaks and keep a single link as below: { "clientId": "", "clientSecret": "", "subscriptionId": "", "tenantId": "", (...) }

  1. Go to the settings of your forked GitHub project GitHub Repo Setting

  2. Click "Secrets" -> "Actions" -> "New Repository Secret" New Repository Secret

Secret name is "AZURE_CREDENTIALS". Value is the single line that we prepared before as below: { "clientId": "", "clientSecret": "", "subscriptionId": "", "tenantId": "", (...) }

Generate the image

  1. Go to the forked GitHub project’s "Actions" page GitHub Actions

Enable it if there is an option asking to click.

  1. Define the software to install Go to images/VSCodeBox/build.pkr.hcl If the software can be installed by choco, just execute the command "choco install" to install. Note: --confirm is required otherwise, it will be installed by confirm yes or no. If the software cannot be installed by choco, please write up the related PowerShell script to install the specific software.

Customize Software

Once you commit the change under the folder images or scripts, the GitHub action pipeline will be triggered.

  1. Go to the GitHub Actions, you will see the status of the pipeline GitHub Actions Workflow