[email protected]
Twitter
LinkedIn
YouTube
GitHub
  • Services
  • Blog
  • Repositories
  • GitHub
  • Resume
  • Contact
Product was added to your cart

Cart

Build a custom image and distribute them to Azure VMSS using GitHub Actions

September 20, 2021DevOps, Tricksjfadev

With the following Github Actions workflow example you build customized images with your app and distribute them using image managing Azure services like Shared Image Gallery After you can use these images for creating Virtual Machines or Virtual Machine Scale Sets 😎

name: Build App Node Image (Azure)

on:
  release:
    types:
      - created

jobs:
  BUILD-APP-NODE-IMAGE:
    runs-on: ubuntu-latest    
    steps:
    - name: CHECKOUT
      uses: actions/checkout@v2

    - name: WORKFLOW ARTIFACTS
      run:| 
        cd  "$GITHUB_WORKSPACE"
        mkdir workflow-artifacts/
        cp -r dist workflow-artifacts/dist
        cp install.sh workflow-artifacts/install.sh
      
    - name: AZURE LOGIN 
      uses: azure/login@v1
      with:
        creds: ${{secrets.AZURE_CREDENTIALS}}

    - name: BUILD VM IMAGE      
      uses: azure/build-vm-image@v0
      with:        
        resource-group-name: 'MyApp'
        managed-identity: 'myapp-imagebuilder'
        location: 'westeurope'
        vm-size: 'Standard_D4s_v3'
        source-os-type: 'linux'        
        source-image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest
        customizer-source: ${{ GITHUB.WORKSPACE }}/workflow-artifacts
        customizer-script:| 
          sudo mkdir -p /var/www/myapp
          sudo cp -r /tmp/workflow-artifacts/* /var/www/myapp/
          cd /var/www/myapp/
          sudo ./install.sh
        dist-type: 'SharedImageGallery'
        dist-resource-id: '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyApp/providers/Microsoft.Compute/galleries/MyAppImageGallery/images/myapp-node'
        dist-location: 'westeurope'
For more info check this repository:

Github action to create custom virtual machine images that contain artifacts built in CI workflows
https://github.com/Azure/build-vm-image
27 forks.
40 stars.
11 open issues.

Recent commits:
  • Merge pull request #24 from johndowns/task-parameters-locations-jsResync locations with documented allowed locations (JavaScript update), GitHub
  • Resync locations with documented allowed locations, John Downs
  • Merge pull request #20 from johndowns/task-parameters-locationsResync locations with documented allowed locations, GitHub
  • Resync locations with documented allowed locations, John Downs
  • Merge pull request #19 from larryclaman/masterFixed typos, GitHub

: Azure, Build Image, Cloud, Deploy, Github Actions, VM, VMSS

Services

  • Excel2chatGPT $10.00
  • Bot Tok $45.00
  • Fix bugs in your PHP Symfony App $70.00 / hr
  • Fix bugs in your Wordpress Site $70.00 / hr
  • Tasks Automation using Node.js $70.00 / hr

Blog

  • How to Pay with a Bank Card on Cryptomus
  • Complete Beginner’s Guide to Bot Tok: Terminal Commands Explained
  • Top Site to Gain Views on TikTok
  • Jfa Whatsapp Chatbot
  • TikTok Bot

Explore

  • Free 10 Tiktok Likes
  • Free 2K TikTok Views
  • Free 100 TikTok Favorites
  • Free 300 TikTok Shares
  • Buy TikTok Views
  • Free 100 Instagram Likes
Twitter
LinkedIn
YouTube
GitHub

© 2013-2025 Jordi Fernandes Alves (@jfadev)