GithubHelp home page GithubHelp logo

isabella232 / wordpress-image-builder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/wordpress-image-builder

0.0 0.0 0.0 25 KB

Create a Wordpress image for an Azure Virtual Machine image using Azure Image Builder

License: MIT License

Shell 100.00%

wordpress-image-builder's Introduction

page_type languages products name
sample
azurecli
virtual-machines
azure
image-builder
Create a Wordpress image for an Azure Virtual Machine image using Azure Image Builder

Create a Wordpress image for an Azure Virtual Machine image using Azure Image Builder

Azure Image Builder is an Azure service that allows you to create predefined images with the required settings and software that meets your corporate standards, all of this being done in an automated approach that guarantees consistency and allows you to version version your images while managing them as code.

When building images with Azure Image Builder you will start with a Linux or Windows base image on top of which you will add your customizations as-code. The solution is based on HashiCorp Packer but being a managed service in Azure.

This service allows you to provide some contents and scripts to automate the Virtual Machine configuration and will perform all the necessary steps to generate, generalize and publish your virtual machine image.

Once you have an image ready you can publish it in the Azure Shared Image Gallery or use it as a managed image in VHD that you can later use as part of your automation.

Features

The sample provides:

  • A script to take care of all of the prerequisites to use Azure image builder:
    • Azure provider registrations
    • Resource Group creation
    • User-assigned identity and permissions.
    • Image definition and gallery settings
  • A template used to configure the image, this file will:
    • Define the base image to use and VM profile, in this case it will use Ubuntu 18.04 on a Standard_D1_v2 VM.
    • Include the customization script and the commands to run it. In this sample the script will install Wordpress
    • Image Gallery configuration

Getting Started

Prerequisites

Download the image builder script and edit the environment variable section to match your deployment, provide inputs for the variables as follows:

Variable Description Example
rg_name Resource group name image_builder_rg
location Main Azure Datacenter location westeurope
replicated_location Additional region to replicate the image to northeurope
image_gallery Azure Compute Image Gallery nameame of the image definition to be created ib_gallery
image_def_name Name of the image definition ib_imagedef
image_metadata Name for the image distribution metadata reference ib_premium
subscription_id Subscription ID of the RG you will use xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
publisher Name of the company or person that will publish the image ib_publishing
sku Define a SKU for your image premium
offer Image offer ib_offer

Installation

Follow these steps to deploy the sample:

  • Sign in with Azure CLI
az login
. ./image-builder.sh

Testing

After the script has finished its run, test the image by creating a VM.

az network nsg create -g $rg_name -n wordpressnsg
az network nsg rule create \
  --resource-group $rg_name \
  --nsg-name wordpressnsg \
  --name allow-http \
  --protocol tcp \
  --priority 100 \
  --destination-port-range 80 \
  --access Allow
az vm create \
  --resource-group $rg_name \
  --name wordpressvm \
  --admin-username aibuser \
  --location $location \
  --image "/subscriptions/$subscription_id/resourceGroups/$rg_name/providers/Microsoft.Compute/galleries/$image_gallery/images/$image_def_name/versions/latest" \
  --generate-ssh-keys \
  --nsg wordpressnsg

Get the public IP address of the VM by running:

az vm list-ip-addresses -n wordpressvm --query [0].virtualMachine.network.publicIpAddresses[0].ipAddress -o tsv

Access the IP address via a web browser and Wordpress should be deployed.

Additional resources

wordpress-image-builder's People

Contributors

lanicolas avatar microsoft-github-operations[bot] avatar microsoftopensource 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.