Git Product home page Git Product logo

dev-box-custom-image-demo's Introduction

Custom DevBox Image Demo

Overview

This repository creates an Azure Image Builder template which will automatically trigger the creation of an Azure Image that can be used by DevBox.

architecture

Requirements

  • Install the AZ CLI tool
  • Connect to your Azure tenant using az login
  • Connect to the appropriate subscription az account set --subscription $subscriptionID
  • Access in Azure to create resources (Requires Owner permission as the demo assigns an RBAC role to a managed identity)
  • Ensure that the correct resource providers are enabled on the subscription resource provider docs

What's Included

The code in this repository will create the following resources in Azure:

  • Azure Compute Gallery: A gallery for Virtual Machine images to be stored and distributed for consumption.
  • VM Image Definition: The Image definitions that are versioned and publish to the Compute Gallery.
  • Image Template: Azure Image Builder template used to create a Virtual Machine image that can be used by DevBox.
  • Deployment Script: Triggers the image template build to create a new image.
  • Managed Identity: The identity used by the Virtual Machine Image definition to spin-up a Virtual Machine, Virtual Network and create an image.

Custom Image Changes

The scripts that Azure Image Builder will use to build the image template for DevBox are in the installScripts directory. The reason the scripts are split out of the Bicep module is to:

  • Simplifies developing custom images.
  • Improves testing and readability by supporting writing scripts in PowerShell directly.
  • Allow linting on scripts and encourage the use of advanced PowerShell.
  • Reduces the error-rate of needing to write PowerShell within a Bicep module.
  • Enables reusing and sharing scripts.

Scripts

The structure used in this repository can be used as an example for installing any required security or operational toolings.

  • common.ps1: Used for any mandatory or shared tooling that should be installed on any DevBox image. This saves needing to store and write the same install commands for different images.

  • developers.ps1: An example of how to setup a install script for a specific persona. This script is passed through to the deploy.bicep script and used in the developerImage module.

To create a new profile, simply copy the existing developerImage module and update the appropriate fields.

Installation Instructions

  1. Create a resource group in Azure to store the custom image resources in.

  2. Clone this repository and update the deploy.bicep file variables.

  3. (Optional) - Update the PowerShell scripts in the installScripts directory.

  4. Run the following command to deploy the resources: az deployment group create --name devboxtest --resource-group $yourResourceGroup --template-file deploy.bicep.
    Note: The Image build process is slow and can take 30 minutes.

  5. Assign the DevCenter instance access to the Resource Group used in the above steps.

  6. Add the compute gallery to your DevBox instance.

  7. Then add the new image to a dev box definition.
    Note: The validation process can take 15 minutes.

  8. Test the new custom image.

Troubleshooting

To troubleshoot the Custom Image creation and installation of the scripts, follow the troubleshooting guide.


The code in the developer.ps1 file writes the chocolatey log file to the console so it can be picked up in the above troubleshooting guide.

Documentation

dev-box-custom-image-demo's People

Contributors

ms-sambell avatar

Stargazers

Jason Leong avatar

Watchers

 avatar  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.