Erhalten Sie alle Bilderlisten für VMs in Azure Cloud

Erhalten Sie alle Bilderlisten für VMs in Azure Cloud

Wenn Sie Ihre Umgebung in Azure Cloud mithilfe des IaaC-Ansatzes (Infrastructure as a Code) erstellen, treten bei der Neubereitstellung manchmal Probleme auf. Das liegt daran, dass Leute von Microsoft ihre VM-Images mit neuen Softwareversionen aktualisieren. Daher haben diese neuen Bilder neue IDs und Sie müssen Ihre ARM- oder Powershell-Skripts aktualisieren.

Ich habe ein Skript geschrieben, mit dem ich neue Versionen von Bildern finden kann.

Login-AzureRmAccount;

#Select Region
$location = (Get-AzureRmLocation).location | Out-GridView -Title "Select Azure location" -PassThru;

#Select publisher
$publisher = Get-AzureRmVMImagePublisher -Location $location | Select -ExpandProperty PublisherName | Out-GridView -Title "Select Publisher" -PassThru;

#Get all offers for selected publisher
$Alloffers = @(Get-AzureRmVMImageOffer -Location $location -Publisher $publisher | Select -ExpandProperty Offer);

#Get all images for all skus of all offers for the selected publisher
foreach ($Offer in $Alloffers)
{
    $Allskus = (Get-AzureRmVMImageSku -Location $location -Publisher $publisher -Offer $offer | Select  -ExpandProperty Skus);
    foreach ($sku in $Allskus)
    {
        $Allimages += @(Get-AzureRmVMImage -Location $location -PublisherName $publisher -Offer $offer -Skus $sku);
    }
}

$Allversions = $Allimages | select Version,Skus,Offer,PublisherName | Sort-Object Skus;

Write-Output $Allversions;

 

Hier ist eine Beispielausgabe:

 

Version     Skus       Offer                    PublisherName     
-------     ----       -----                    -------------     
11.5.65235  Enterprise SQL2012SP3-WS2012R2      MicrosoftSQLServer
11.3.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
11.7.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
12.0.44499  Enterprise SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
12.9.50001  Enterprise SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.9.50005  Enterprise SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
13.5.31640  Enterprise SQL2016-WS2012R2         MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
11.5.65235  Enterprise SQL2012SP3-WS2012R2      MicrosoftSQLServer
11.5.65235  Enterprise SQL2012SP3-WS2012R2      MicrosoftSQLServer
11.3.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
12.0.44499  Enterprise SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
12.9.50001  Enterprise SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.9.50005  Enterprise SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
13.5.31640  Enterprise SQL2016-WS2012R2         MicrosoftSQLServer
13.0.21640  Enterprise SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.500110 Enterprise SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
13.0.500110 Enterprise SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
11.7.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
13.0.21640  Enterprise SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
13.0.400110 Enterprise SQL2016SP1-WS2016        MicrosoftSQLServer
12.9.50005  Enterprise SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
13.0.21640  Enterprise SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
12.9.50001  Enterprise SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.0.44499  Enterprise SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
11.7.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
13.5.31640  Enterprise SQL2016-WS2012R2         MicrosoftSQLServer
11.3.65235  Enterprise SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
2.0.0       Evaluation SQL2017-RHEL73           MicrosoftSQLServer
2.0.0       Evaluation SQL2017-RHEL73           MicrosoftSQLServer
2.0.0       Evaluation SQL2017-RHEL73           MicrosoftSQLServer
13.0.400111 Express    SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.400111 Express    SQL2016SP1-WS2016        MicrosoftSQLServer
12.9.50001  Express    SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.9.50001  Express    SQL2014SP2-WS2012R2      MicrosoftSQLServer
13.0.500110 Express    SQL2016SP1-WS2016        MicrosoftSQLServer
11.5.65235  Express    SQL2012SP3-WS2012R2      MicrosoftSQLServer
11.5.65235  Express    SQL2012SP3-WS2012R2      MicrosoftSQLServer
12.9.50001  Express    SQL2014SP2-WS2012R2      MicrosoftSQLServer
11.5.65235  Express    SQL2012SP3-WS2012R2      MicrosoftSQLServer
13.0.400111 Express    SQL2016SP1-WS2016        MicrosoftSQLServer
13.5.31640  SQLDEV     SQL2016-WS2012R2         MicrosoftSQLServer
13.0.21640  SQLDEV     SQL2016-WS2016           MicrosoftSQLServer
13.0.400111 SQLDEV     SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.500110 SQLDEV     SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.400111 SQLDEV     SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.21640  SQLDEV     SQL2016-WS2016           MicrosoftSQLServer
13.0.21640  SQLDEV     SQL2016-WS2016           MicrosoftSQLServer
13.0.400111 SQLDEV     SQL2016SP1-WS2016        MicrosoftSQLServer
13.5.31640  SQLDEV     SQL2016-WS2012R2         MicrosoftSQLServer
13.5.31640  SQLDEV     SQL2016-WS2012R2         MicrosoftSQLServer
13.0.500110 Standard   SQL2016SP1-WS2016        MicrosoftSQLServer
12.9.50001  Standard   SQL2014SP2-WS2012R2      MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
11.5.65236  Standard   SQL2012SP3-WS2012R2      MicrosoftSQLServer
13.0.21640  Standard   SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
11.5.65236  Standard   SQL2012SP3-WS2012R2      MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
11.7.65236  Standard   SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
12.7.50005  Standard   SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016        MicrosoftSQLServer
12.7.50005  Standard   SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
12.0.444999 Standard   SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
13.0.500110 Standard   SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
13.0.21640  Standard   SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
12.7.50005  Standard   SQL2014SP2-WS2012R2-BYOL MicrosoftSQLServer
12.9.50001  Standard   SQL2014SP2-WS2012R2      MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016-BYOL   MicrosoftSQLServer
12.0.444999 Standard   SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
13.0.400110 Standard   SQL2016SP1-WS2016        MicrosoftSQLServer
12.0.444999 Standard   SQL2014SP1-WS2012R2-BYOL MicrosoftSQLServer
12.9.50001  Standard   SQL2014SP2-WS2012R2      MicrosoftSQLServer
13.0.21640  Standard   SQL2016-WS2012R2-BYOL    MicrosoftSQLServer
11.7.65236  Standard   SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
11.7.65236  Standard   SQL2012SP3-WS2012R2-BYOL MicrosoftSQLServer
11.5.65236  Standard   SQL2012SP3-WS2012R2      MicrosoftSQLServer
12.9.50001  Web        SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.5.50000  Web        SQL2012SP3-WS2012R2      MicrosoftSQLServer
12.5.50000  Web        SQL2012SP3-WS2012R2      MicrosoftSQLServer
13.0.400110 Web        SQL2016SP1-WS2016        MicrosoftSQLServer
12.5.50000  Web        SQL2012SP3-WS2012R2      MicrosoftSQLServer
13.0.400110 Web        SQL2016SP1-WS2016        MicrosoftSQLServer
13.0.500110 Web        SQL2016SP1-WS2016        MicrosoftSQLServer
12.9.50001  Web        SQL2014SP2-WS2012R2      MicrosoftSQLServer
12.9.50001  Web        SQL2014SP2-WS2012R2      MicrosoftSQLServer
13.0.400110 Web        SQL2016SP1-WS2016        MicrosoftSQLServer

 

 

Tags: powershell (de), skript, azure (de)

Drucken