Skip to content

Commit 776f17a

Browse files
Merge pull request #233316 from Sandido/adsandor/cliAndPSImages
Provide Image aliases for PS and CLI documentation
2 parents 6d7a3a3 + 785f458 commit 776f17a

File tree

2 files changed

+79
-12
lines changed

2 files changed

+79
-12
lines changed

articles/virtual-machines/linux/cli-ps-findimage.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ You can also browse available images and offers using the [Azure Marketplace](ht
2222

2323
A Marketplace image in Azure has the following attributes:
2424

25-
* **Publisher**: The organization that created the image. Examples: Canonical, RedHat, SUSE
26-
* **Offer**: The name of a group of related images created by a publisher. Examples: UbuntuServer, RHEL, sles-12-sp5
27-
* **SKU**: An instance of an offer, such as a major release of a distribution. Examples: 18.04-LTS, 7_9, gen2
25+
* **Publisher**: The organization that created the image. Examples: Canonical, RedHat, SUSE.
26+
* **Offer**: The name of a group of related images created by a publisher. Examples: 0001-com-ubuntu-server-jammy, RHEL, sles-15-sp3.
27+
* **SKU**: An instance of an offer, such as a major release of a distribution. Examples: 22_04-lts-gen2, 8-lvm-gen2, gen2.
2828
* **Version**: The version number of an image SKU.
2929

3030
These values can be passed individually or as an image *URN*, combining the values separated by the colon (:). For example: *Publisher*:*Offer*:*Sku*:*Version*. You can replace the version number in the URN with `latest` to use the latest version of the image.
@@ -41,21 +41,41 @@ You can run the [az vm image list --all](/cli/azure/vm/image) to see all of the
4141
az vm image list --output table
4242
```
4343

44-
The output includes the image URN. You can also use the *UrnAlias*, which is a shortened version created for popular images like *UbuntuLTS*.
44+
The output includes the image URN. You can also use the *UrnAlias*, which is a shortened version created for popular images like *Ubuntu2204*.
45+
The Linux image alias names and their details outputted by this command are:
4546

4647
```output
4748
Architecture Offer Publisher Sku Urn UrnAlias Version
4849
-------------- ---------------------------- ---------------------- ---------------------------------- ------------------------------------------------------------------------------ ----------------------- ---------
4950
x64 CentOS OpenLogic 7.5 OpenLogic:CentOS:7.5:latest CentOS latest
51+
x64 CentOS OpenLogic 8_5-gen2 OpenLogic:CentOS:8_5-gen2:latest CentOS85Gen2 latest
5052
x64 debian-10 Debian 10 Debian:debian-10:10:latest Debian latest
53+
x64 Debian11 Debian 11-backports-gen2 Debian:debian-11:11-backports-gen2:latest Debian-11 latest
5154
x64 flatcar-container-linux-free kinvolk stable kinvolk:flatcar-container-linux-free:stable:latest Flatcar latest
55+
x64 flatcar-container-linux-free kinvolk stable-gen2 kinvolk:flatcar-container-linux-free:stable-gen2:latest FlatcarLinuxFreeGen2 latest
5256
x64 opensuse-leap-15-3 SUSE gen2 SUSE:opensuse-leap-15-3:gen2:latest openSUSE-Leap latest
57+
x64 opensuse-leap-15-4 SUSE gen2 SUSE:opensuse-leap-15-4:gen2:latest OpenSuseLeap154Gen2 latest
5358
x64 RHEL RedHat 7-LVM RedHat:RHEL:7-LVM:latest RHEL latest
59+
x64 RHEL RedHat 8-lvm-gen2 RedHat:RHEL:8-lvm-gen2:latest RHELRaw8LVMGen2 latest
5460
x64 sles-15-sp3 SUSE gen2 SUSE:sles-15-sp3:gen2:latest SLES latest
5561
x64 UbuntuServer Canonical 18.04-LTS Canonical:UbuntuServer:18.04-LTS:latest UbuntuLTS latest
56-
[...]
62+
x64 0001-com-ubuntu-server-jammy Canonical 22_04-lts-gen2 Canonical:UbuntuServer:22_04-lts-gen2:latest Ubuntu2204 latest
5763
```
5864

65+
The Windows image alias names and their details outputted by this command are:
66+
67+
```output
68+
Architecture Offer Publisher Sku Urn Alias Version
69+
-------------- ---------------------------- ---------------------- ---------------------------------- ------------------------------------------------------------------------------ ----------------------- ---------
70+
x64 WindowsServer MicrosoftWindowsServer 2022-Datacenter MicrosoftWindowsServer:WindowsServer:2022-Datacenter:latest Win2022Datacenter latest
71+
x64 WindowsServer MicrosoftWindowsServer 2022-datacenter-azure-edition-core MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition-core:latest Win2022AzureEditionCore latest
72+
x64 WindowsServer MicrosoftWindowsServer 2019-Datacenter MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest Win2019Datacenter latest
73+
x64 WindowsServer MicrosoftWindowsServer 2016-Datacenter MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest Win2016Datacenter latest
74+
x64 WindowsServer MicrosoftWindowsServer 2012-R2-Datacenter MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest Win2012R2Datacenter latest
75+
x64 WindowsServer MicrosoftWindowsServer 2012-Datacenter MicrosoftWindowsServer:WindowsServer:2012-Datacenter:latest Win2012Datacenter latest
76+
```
77+
78+
5979
## Find specific images
6080

6181
You can filter the list of images by `--publisher` or another parameter to limit the results.

articles/virtual-machines/windows/cli-ps-findimage.md

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,58 @@ A Marketplace image in Azure has the following attributes:
3030

3131
These values can be passed individually or as an image *URN*, combining the values separated by the colon (:). For example: *Publisher*:*Offer*:*Sku*:*Version*. You can replace the version number in the URN with `latest` to use the latest version of the image.
3232

33-
If the image publisher provides additional license and purchase terms, then you must accept those before you can use the image. For more information, see [Accept purchase plan terms](#accept-purchase-plan-terms).
33+
If the image publisher provides other license and purchase terms, then you must accept those before you can use the image. For more information, see [Accept purchase plan terms](#accept-purchase-plan-terms).
34+
35+
## Default Images
36+
37+
Powershell offers several pre-defined image aliases to make the resource creation process easier. There are different images for resources with either a Windows or Linux operating system. Several Powershell cmdlets, such as `New-AzVM` and `New-AzVmss`, allow you to input the alias name as a parameter.
38+
For example:
39+
40+
```powershell
41+
$rgname = <Resource Group Name>
42+
$location = <Azure Region>
43+
$vmName = "v" + $rgname
44+
$domainNameLabel = "d" + $rgname
45+
$securePassword = <Password> | ConvertTo-SecureString -AsPlainText -Force
46+
$username = <Username>
47+
$credential = New-Object System.Management.Automation.PSCredential ($username, $securePassword)
48+
New-AzVM -ResourceGroupName $rgname -Location $location -Name $vmName -Image CentOS85Gen2 -Credential $credential -DomainNameLabel $domainNameLabel
49+
```
50+
51+
The Linux image alias names and their details are:
52+
```output
53+
Alias Architecture Offer Publisher Sku Urn Version
54+
----------------------- -------------- ---------------------------- ---------------------- ---------------------------------- ------------------------------------------------------------------------------ ---------
55+
CentOS x64 CentOS OpenLogic 7.5 OpenLogic:CentOS:7.5:latest latest
56+
CentOS85Gen2 x64 CentOS OpenLogic 8_5-gen2 OpenLogic:CentOS:8_5-gen2:latest latest
57+
Debian11 x64 Debian-11 Debian 11-backports-gen2 Debian:debian-11:11-backports-gen2:latest latest
58+
Debian10 x64 Debian-10 Debian 10 Debian:debian-10:10:latest latest
59+
FlatcarLinuxFreeGen2 x64 flatcar-container-linux-free kinvolk stable kinvolk:flatcar-container-linux-free:stable:latest latest
60+
openSUSE-Leap x64 opensuse-leap-15-3 SUSE gen2 SUSE:opensuse-leap-15-3:gen2:latest latest
61+
OpenSuseLeap154Gen2 x64 opensuse-leap-15-4 SUSE gen2 SUSE:opensuse-leap-15-4:gen2:latest latest
62+
RHEL x64 RHEL RedHat 7-LVM RedHat:RHEL:7-LVM:latest latest
63+
RHELRaw8LVMGen2 x64 RHEL RedHat 8-lvm-gen2 RedHat:RHEL:8-lvm-gen2:latest latest
64+
SLES x64 sles-15-sp3 SUSE gen2 SUSE:sles-15-sp3:gen2:latest latest
65+
UbuntuLTS x64 UbuntuServer Canonical 16.04-LTS Canonical:UbuntuServer:16.04-LTS:latest latest
66+
Ubuntu2204 x64 0001-com-ubuntu-server-jammy Canonical 22_04-lts-gen2 Canonical:UbuntuServer:22_04-lts-gen2:latest latest
67+
```
68+
69+
The Windows image alias names and their details are:
70+
```output
71+
Alias Architecture Offer Publisher Sku Urn Version
72+
----------------------- -------------- ---------------------------- ---------------------- ---------------------------------- ------------------------------------------------------------------------------ ---------
73+
Win2022Datacenter x64 WindowsServer MicrosoftWindowsServer 2022-Datacenter MicrosoftWindowsServer:WindowsServer:2022-Datacenter:latest latest
74+
Win2022AzureEditionCore x64 WindowsServer MicrosoftWindowsServer 2022-datacenter-azure-edition-core MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition-core:latest latest
75+
Win10 x64 Windows MicrosoftVisualStudio Windows-10-N-x64 MicrosoftVisualStudio:Windows:Windows-10-N-x64:latest latest
76+
Win2019Datacenter x64 WindowsServer MicrosoftWindowsServer 2019-Datacenter MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest latest
77+
Win2016Datacenter x64 WindowsServer MicrosoftWindowsServer 2016-Datacenter MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest latest
78+
Win2012R2Datacenter x64 WindowsServer MicrosoftWindowsServer 2012-R2-Datacenter MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest latest
79+
Win2012Datacenter x64 WindowsServer MicrosoftWindowsServer 2012-Datacenter MicrosoftWindowsServer:WindowsServer:2012-Datacenter:latest latest
80+
```
3481

3582
## List images
3683

37-
You can use PowerShell to narrow down a list of images. Replace the values of the variables to meet your needs.
84+
You can use PowerShell to narrow down a list of images if you want to use a specific image that is not provided by default. Replace the values of the below variables to meet your needs.
3885

3986
1. List the image publishers using [Get-AzVMImagePublisher](/powershell/module/az.compute/get-azvmimagepublisher).
4087

@@ -65,12 +112,12 @@ You can use PowerShell to narrow down a list of images. Replace the values of th
65112
66113
Now you can combine the selected publisher, offer, SKU, and version into a URN (values separated by :). Pass this URN with the `-Image` parameter when you create a VM with the [New-AzVM](/powershell/module/az.compute/new-azvm) cmdlet. You can also replace the version number in the URN with `latest` to get the latest version of the image.
67114
68-
If you deploy a VM with a Resource Manager template, then you'll set the image parameters individually in the `imageReference` properties. See the [template reference](/azure/templates/microsoft.compute/virtualmachines).
115+
If you deploy a VM with a Resource Manager template, then you must set the image parameters individually in the `imageReference` properties. See the [template reference](/azure/templates/microsoft.compute/virtualmachines).
69116
70117
71118
## View purchase plan properties
72119
73-
Some VM images in the Azure Marketplace have additional license and purchase terms that you must accept before you can deploy them programmatically. You'll need to accept the image's terms once per subscription.
120+
Some VM images in the Azure Marketplace have other license and purchase terms that you must accept before you can deploy them programmatically. You need to accept the image's terms once per subscription.
74121
75122
To view an image's purchase plan information, run the `Get-AzVMImage` cmdlet. If the `PurchasePlan` property in the output is not `null`, the image has terms you need to accept before programmatic deployment.
76123
@@ -81,7 +128,7 @@ $version = "2016.127.20170406"
81128
Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Skus $skuName -Version $version
82129
```
83130

84-
The output will look similar to the following:
131+
The output looks similar to the following output:
85132

86133
```output
87134
Id : /Subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.Compute/Locations/westus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2019.0.20190115
@@ -106,7 +153,7 @@ The example below shows a similar command for the *Data Science Virtual Machine
106153
Get-AzVMImage -Location "westus" -PublisherName "microsoft-ads" -Offer "windows-data-science-vm" -Skus "windows2016" -Version "0.2.02"
107154
```
108155

109-
The output will look similar to the following:
156+
The output looks similar to the following output:
110157

111158
```
112159
Id : /Subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.Compute/Locations/westus/Publishers/microsoft-ads/ArtifactTypes/VMImage/Offers/windows-data-science-vm/Skus/windows2016/Versions/19.01.14
@@ -216,7 +263,7 @@ $vm = Get-azvm `
216263
$vm.Plan
217264
```
218265

219-
If you didn't get the plan information before the original VM was deleted, you can file a [support request](https://portal.azure.com/#create/Microsoft.Support). They will need the VM name, subscription ID and the time stamp of the delete operation.
266+
If you didn't get the plan information before the original VM was deleted, you can file a [support request](https://portal.azure.com/#create/Microsoft.Support). The support request needs at minimum the VM name, subscription ID and the time stamp of the delete operation.
220267

221268
To create a VM using a VHD, refer to this article [Create a VM from a specialized VHD](create-vm-specialized.md) and add in a line to add the plan information to the VM configuration using [Set-AzVMPlan](/powershell/module/az.compute/set-azvmplan) similar to the following:
222269

0 commit comments

Comments
 (0)