Chapter 1. Pushing VHD images to Microsoft Azure cloud using the GUI image builder tool

You can create .vhd images using image builder. Then, you can push the .vhd images to a Blob Storage of the Microsoft Azure Cloud service provider.

Prerequisites

Procedure

  1. For the blueprint name, click the Images tab .
  2. Click Create Image to create your customized image.

    A pop-up window opens.

    1. From the "Type drop-down menu list, select the Azure Disk Image (.vhd) image.
    2. Check the Upload to Microsoft Azure check box to upload your image to the Microsoft Azure Cloud and click Next.
    3. To authenticate your access to Microsoft Azure, type your "Storage account" and "Storage access key" in the corresponding fields. Click Next.

      You can find your Microsoft Storage account details in the Settings→Access Key menu list.

    4. Type a "Image name" to be used for the image file that will be uploaded and the Blob "Storage container" in which the image file you want to push the image into. Click Next.
    5. Review the information you provided and click Finish.

      Optionally, you can click Back to modify any incorrect detail.

  3. When the image creation process starts, a small pop-up on the upper right side displays with the message: Image creation has been added to the queue.

    After the image process creation is complete, click the blueprint you created the image from. In the Images tab, you can see the Image build complete status for the image you created.

  4. To access the image you pushed into Microsoft Azure Cloud, access the Microsoft Azure portal.
  5. On the search bar, type Images and select the first entry under Services. You are redirected to the Image dashboard.
  6. Click +Add. You are redirected to the Create an Image dashboard.

    Insert the below details:

    1. Name: Choose a name for your new image.
    2. Resource Group: Select a resource group.
    3. Location: Select the location that matches the regions assigned to your storage account. Otherwise you will not be able to select a blob.
    4. OS Type: Set the operating system type to Linux.
    5. VM Generation: Keep the VM generation set on Gen 1.
    6. Storage Blob: Click Browse on the right of Storage blob input. Use the dialog to find the image you uploaded earlier.

      Keep the remaining fields as in the default choice.

  7. Click Create to create the image. After the image is created, you can see the message Successfully created image in the upper right corner.
  8. Click Refresh to see your newly created image and open it.
  9. Click + Create VM. You are redirected to the Create a virtual machine dashboard.
  10. In the Basic tab, under Project Details, your Subscription and the Resource Group are already pre-set.

    If you want to create a new Resource Group:

    1. Click Create new.

      A pop-up prompts you to create the Resource Group Name container.

    2. Insert a name and click OK.

      If you want to keep the already pre-set Resource Group:

  11. Under Instance Details, enter:

    1. Virtual machine name
    2. Region
    3. Image: The image you created is pre-selected by default.
    4. Size: Choose a VM size that better suits your needs.

      Keep the remaining fields default.

  12. Under Administrator account, enter the below details:

    1. Username: the name of the account administrator.
    2. SSH public key source: from the drop-down menu, select Generate new key pair.

      You can either use the key pair you already have or you can create a new key pair. Alternatively, you can use image builder to add a user to the image with a preset public key. See Creating a user account with SSH key for more details.

    3. Key pair name: insert a name for the key pair.
  13. Under Inbound port rules, select values for each of the fields:

    1. Public inbound ports: Allow selected ports.
    2. Select inbound ports: Use the default set SSH (22).
  14. Click Review + Create. You are redirected to the Review + create tab and receive a confirmation that the validation passed.
  15. Review the details and click Create.

    Optionally, you can click Previous to fix previous options selected.

  16. A generates new key pair window opens. Click Download private key and create resources.

    Save the key file as "yourKey.pem".

  17. After the deployment is complete, click Go to resource.
  18. You are redirected to a new window with your VM details. Select the public IP address on the upper right side of the page and copy it to your clipboard.

Now, to create an SSH connection with the VM to connect to the Virtual Machine.

  1. Open a terminal.
  2. At your prompt, open an SSH connection to your VM. Replace the IP address with the one from your VM, and replace the path to the .pem with the path to where the key file was downloaded.

    # ssh -i ./Downloads/yourKey.pem azureuser@10.111.12.123
  3. You are required to confirm if you want to continue to connect. Type yes to continue.

As a result, the output image you pushed to the Microsoft Azure Storage Blob is ready to be provisioned.