Windows 10 Image Series – Part 3 – Shared Image Gallery

In this series I am going to show you how build a Windows 10 Image via Azure Pipelines and DevOps without 3rd party tooling, welcome to part 3!

Part 3 is about the Shared Image Gallery. This is a service within Microsoft Azure to publish images and we are publishing our managed image in the gallery for distribution.

Prerequisites

Part 1 & 2 of this series needs to be completed. These are the links:

Windows 10 Image Series – Part 1 (Creating the Windows VM Pipeline)

Windows 10 Image Series – Part 2 (Artifacts & Application Installation)

Therefore, the prerequisites from part 1 are also required for this part. So:

Firstly, I am assuming that you have knowledge of Azure DevOps. These are the parts that already need be setup:

In addition, if you don’t have knowledge about Azure DevOps and still want to follow this series please let me know. I might write a blog about the preparing Azure DevOps.

Checkout/Skip to other parts:

0. Windows 10 Image Series – Part 0 (Preparing Azure/Azure DevOps)

1. Windows 10 Image Series – Part 1 (Creating the Windows VM Pipeline)

2. Windows 10 Image Series – Part 2 (Artifacts & Application Installation)

4. Windows 10 Image Series – Part 4 (SessionHost Deployment from Image)

5. Windows 10 Image Series – Part 5 (Convert the Image Build pipeline to YAML)

6. Windows 10 Image Series – Part 6 (Deploy Sessionhosts with Bicep and YAML)

Creating the Shared Image Gallery

There are 2 options to create the shared image gallery. Powershell and GUI based. I am showing the Powershell option.

Firstly, log on to Azure via Powershell with this command:

After that, make sure you select the correct subscription:

Now it is time to create the Shared Image Gallery. In the example we create a new resource group for the Shared Image Gallery

As a result, this is the resource group:

Windows 10 Image Series – Part 3 - Shared Image Gallery Resource Group creation.

After that, run the following code to create the Shared Image Gallery:

It takes a minut or so but this is the Shared Image Gallery:

Windows 10 Image Series – Part 3 - Shared Image Gallery creation.

Creating Shared Image Gallery Image Definition

We continue in our same Powershell session to create the Shared Image Gallery Definition. In addition, the image definition is needed for us to upload our image in the Shared Image Gallery.

Use this code to create the image definition:

As a result, this image definition is now available in the Shared Image Gallery:

Windows 10 Image Series – Part 3 - Image Definition

Add the Shared Image Gallery to the Azure DevOps Pipeline

Firstly, we add a new job to the existing pipeline:

Name the job and fill in the parameters:

Furthermore, use this script in the Inline Script section:

After that, run the pipeline.

When the Azure CLI task for the Shared Image Gallery upload runs the task will report every minute about the upload status:

(The task runs for about 12 – 15 minutes)

Furthermore, you can see a new version in the Shared Image Gallery:

After a while (12 – 15 minutes) the job has finished:

This was Windows 10 Image Series – Part 3, check out the other parts:

0. Windows 10 Image Series – Part 0 (Preparing Azure/Azure DevOps)

1. Windows 10 Image Series – Part 1 (Creating the Windows VM Pipeline)

2. Windows 10 Image Series – Part 2 (Artifacts & Application Installation)

4. Windows 10 Image Series – Part 4 (SessionHost Deployment from Image)

5. Windows 10 Image Series – Part 5 (Convert the Image Build pipeline to YAML)

6. Windows 10 Image Series – Part 6 (Deploy Sessionhosts with Bicep and YAML)

References

Microsoft Doc about Shared Image Gallery

Related Posts

8 thoughts on “Windows 10 Image Series – Part 3 – Shared Image Gallery

Leave a Reply

Your email address will not be published. Required fields are marked *