Microsoft Azure – Create Image Gallery and Image Definition
Last Updated :
30 Mar, 2023
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:-
- Owner or Contributor or Custom Read and Write Role to deploy resources within subscription or resource group.
- Existing resource group. Create one if you wish to add a new resource group.
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
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...