New-AzGalleryImageDefinition
Create a gallery image definition.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzGalleryImageDefinition
[-ResourceGroupName] <String>
[-GalleryName] <String>
[-Name] <String>
[-AsJob]
[-Location] <String>
-Publisher <String>
-Offer <String>
-Sku <String>
-OsState <OperatingSystemStateTypes>
-OsType <OperatingSystemTypes>
[-Description <String>]
[-DisallowedDiskType <String[]>]
[-EndOfLifeDate <DateTime>]
[-Eula <String>]
[-HyperVGeneration <String>]
[-MinimumMemory <Int32>]
[-MinimumVCPU <Int32>]
[-MaximumMemory <Int32>]
[-MaximumVCPU <Int32>]
[-PrivacyStatementUri <String>]
[-PurchasePlanName <String>]
[-PurchasePlanProduct <String>]
[-PurchasePlanPublisher <String>]
[-ReleaseNoteUri <String>]
[-Tag <Hashtable>]
[-Feature <GalleryImageFeature[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create a gallery image definition.
Examples
Example 1: Create an image definition for specialized linux images
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$description = "My gallery"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Specialized" -OsType "Linux" -Description $description
Creates a gallery image definition to contain image versions for specialized linux images.
Example 2: Create an image definition for generalized linux images
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$description = "My gallery"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -Description $description
Creates a gallery image definition to contain image versions for generalized linux images.
Example 3: Create an image definition for specialized windows images
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$description = "My gallery"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Specialized" -OsType "Windows" -Description $description
Creates a gallery image definition to contain image versions for specialized windows images.
Example 4: Create an image definition for generalized windows images and set features.
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$description = "My gallery"
$IsHibernateSupported = @{Name='IsHibernateSupported';Value='True'}
$IsAcceleratedNetworkSupported = @{Name='IsAcceleratedNetworkSupported';Value='False'}
$features = @($IsHibernateSupported,$IsAcceleratedNetworkSupported)
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Windows" -Description $description -Feature $features
Creates a gallery image definition to contain image versions for generalized windows images.
Example 5: Create an image definition with plan information
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$purchasePlanName = "myPlanName"
$purchasePlanProduct = "myPlanProduct"
$purchasePlanPublisher = "myPlanPublisher"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -PurchasePlanName $purchasePlanName -PurchasePlanProduct $purchasePlanProduct -PurchasePlanPublisher $purchasePlanPublisher
Creates a gallery image definition for linux generalized images and define the plan name, product, and publisher. Only image versions that match the plan information can be added to this definition.
Example 6: Create an image definition and indicate end of life date
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$endOfLifeDate = "2024-08-02T00:00:00+00:00"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -EndOfLifeDate $endOfLifeDate
This example has the end-of-life date for image definitions set to August 2, 2024 at mignight UTC. End-of-life dates can be specified for image definitions and image versions. Image definitions can still be used after the end-of-life dates.
Example 7: Create an image definition and recommend minimum and maximum CPU and memory (GB)
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$minMemory = 32
$maxMemory = 128
$minVCPU = 2
$maxVCPU = 8
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -MinimumMemory $minMemory -MaximumMemory $maxMemory -MinimumVCPU $minVCPU -MaximumVCPU $maxVCPU
Creates a gallery image definition and recommends the minimum and maximum ranges for the CPU and memory that the image versions in this image definition support. Image versions can still be used to create virtual machines with memory and vCPU settings outside the recommended ranges.
Example 8: Create an image definition and indicate which OS disk types are not recommended for the image
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$disallowedDiskTypes = @("Standard_LRS")
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -DisallowedDiskType $disallowedDiskTypes
Creates a gallery image definition and indicate which OS disk types may not be compatible with image versions within this image definition. Image versions can still be used to create virtual machines with an OS disk that is one of the disallowed disk types.
Example 9: Create an image definition and provide the EULA, privacy statement URI, and release notes URI
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$location = "eastus"
$publisherName = "GreatPublisher"
$offerName = "GreatOffer"
$skuName = "GreatSku"
$eula = "https://myeula"
$privacyStatementUri = "https://mystatement"
$releaseNoteUri = "https://myreleasenotes"
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Linux" -Eula $eula -PrivacyStatementUri $privacyStatementUri -ReleaseNoteUri $releaseNoteUri
Creates a gallery image definition for linux generalized images and specify either the string or path to an EULA agreement, privacy statement, and release notes tied to all image versions in the image definition.
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The description of the gallery image Definition resource.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The disallowed disk types.
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The end of life date of the gallery Image Definition
| Type: | DateTime |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The Eula agreement for the gallery Image Definition.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
A list of gallery image features.
| Type: | GalleryImageFeature[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the gallery.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Allowed values are V1 and V2.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Resource location
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The maximum of the recommended memory
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The maximum of the recommended CPU core
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The minimum of the recommended memory
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The minimum of the recommended CPU core
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the gallery image definition.
| Type: | String |
| Aliases: | GalleryImageDefinitionName |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the gallery Image Definition offer.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The state of OS
| Type: | OperatingSystemStateTypes |
| Accepted values: | Generalized, Specialized |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The type of OS
| Type: | OperatingSystemTypes |
| Accepted values: | Windows, Linux |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The privacy statement uri.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the gallery Image Definition publisher.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The ID for the purchase plan.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The product ID for the purchase plan.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The publisher ID for the purchase plan.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The release note uri.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the gallery Image Definition SKU.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Resource tags
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
String[]