How spoddar13/azure_imagebuilder works
Project type and purpose
• This is a small automation toolkit for Azure VM image creation. It leverages Azure Image Builder via ARM templates (.json) and PowerShell scripts (.ps1). There is no traditional “frontend/backend” web app here—rather, it’s an infrastructure-as-code (IaC) project that configures and orchestrates Azure services to produce custom VM images.
File structure
• Top‐level files:
• ImageTemplateWin.json, RoleImageCreation.json – ARM (Azure Resource Manager) templates defining the image build pipeline and the managed identity/role assignments.
• psimagebuilder.ps1, testPsScript.ps1 – PowerShell scripts to deploy the templates or run test builds.
• index.html – likely a static documentation or quick‐start page.
• ps/.gitkeep – placeholder to keep an empty directory under source control.
• README.md – minimal, only carries the project title (“azure_imagebuilder”).
• LICENSE – standard licensing info.
README for additional insights
• The README only names the project. We infer functionality from file names:
• “ImageTemplateWin” suggests a Windows‐based image template.
• “RoleImageCreation” suggests that the project also creates or assigns roles/MIs.
Main components
a. User (DevOps engineer)
b. PowerShell orchestration layer
• psimagebuilder.ps1 – deploys the Image Template + Role Template
• testPsScript.ps1 – validates or test‐runs the build
c. ARM Template artifacts
• ImageTemplateWin.json – defines source image, customizations, Azure compute gallery target
• RoleImageCreation.json – defines managed identity, role assignments for the builder
d. Azure services invoked
• Azure Resource Manager (deployment endpoint)
• Azure Image Builder service
• Azure Compute Gallery (or Shared Image Gallery) – to store resulting images
• Optional: Key Vault, Storage Account, or other resources referenced in the templates
Relationships and interactions
1. The user runs psimagebuilder.ps1 locally (or via CI/CD).
2. The script calls Azure Resource Manager REST API or Azure PowerShell cmdlets, passing in the ARM templates (JSON files).
3. ARM service validates and starts a deployment, which:
– Creates (or ensures) a managed identity and role assignment (via RoleImageCreation.json).
– Submits an Image Builder definition (ImageTemplateWin.json) to the Azure Image Builder service.
4. Azure Image Builder spins up a temporary builder VM, applies customizations, captures an image, and publishes it to the Compute Gallery.
5. testPsScript.ps1 can be used to poll or verify that the build completed successfully.
Architectural patterns and design principles
• IaC pattern: infrastructure and configuration defined as code (ARM JSON + scripts).
• Separation of concerns:
• Templates (declarative resources)
• Scripts (imperative orchestration)
• Principle of least privilege: RoleImageCreation.json ensures the builder runs under a specific managed identity with minimal required roles.