Open In App

Microsoft Azure – Create Image Gallery and Image Definition

Pre-requisite:- Azure

In this article, we will show you how to create an image gallery and image definition in Azure which can be used to save images with versions in it. We will be using the simple Azure Powershell commands in the form to script to create this image gallery and definition in azure.



Pre-requisites:-

Implementation

Step 1: Log in to Azure Portal



Step 2: Access Azure Cloud Schell and select PowerShell

Step 3: Create a file named createSharedImgDef.ps1

> touch createSharedImgDef.ps1

 

Step 4: Open the file createSharedImgDef.ps1 using the below command to code

> code createSharedImgDef.ps1

 

Copy and Paste the below script in createSharedImgDef.ps1 and modify the variables of your choice

New-AzGallery `
   -GalleryName "add sigGallery Name" `
   -ResourceGroupName "add RGroup Name" `
   -Location "add RGroup Location" `
   -Description "add sigGallery Description"
   
New-AzGalleryImageDefinition `
   -GalleryName "add sigGallery Name" `
   -ResourceGroupName "add RGroup Name" `
   -Location "add RGroup Location" `
   -Name "add sigGallery DefName" `
   -OsState "add sigGalleryDef OsState" `
   -OsType "add sigGalleryDef OsType" `
   -Publisher "add publisher Name" `
   -Offer "add offerName" `
   -Sku "add skuName"

 

Step 5: Save the file and execute the file using the run command

./createSharedImgDef.ps1

 

Once you are done. Check Image Gallery and Image Definition resources in Azure.

Steps to check the Image Gallery and Image Definition

Step 1: Search for Azure compute galleries from the global search

Step 2:  Select the created resource and verify the Definitions

 

Article Tags :