AzureOSイメージの開発元確認（PublisherName)

# はじめに

AzureのPowerShell で仮想マシンを作ろうとすると開発元（Publisher）の指定に困ります。
なんだそれ？！どうやって確認するんだ？！
PowerShellから次のコマンドで確認できます。

# 1. 発行元（PublisherName）の取得

```
Get-AzureRmVMImagePublisher -Location "リージョン"
sample) Get-AzureRmVMImagePublisher -Location "japaneast" | findstr "Microsoft"
※ findstr しないと結構な量です。
※ 会社名が不明な時は、Azureポータルで会社名を確認してから実行したほうがいいですね。
   ”OpenLogic”を見つけて、CentOSだ！と気づく人はこのページを見なくても大丈夫な人だと思います。

Microsoft                                            japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Applications                         japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Backup.Test                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Backup.Test.Edp                      japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Diagnostics                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Diagnostics.Build.Test               japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Extensions                           japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Monitoring.DependencyAgent           japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Networking.SDN                       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.NetworkWatcher                       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Performance.Diagnostics              japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices                     japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices.Edp                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices.SiteRecovery        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices.SiteRecovery2       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices.WorkloadBackup      japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.RecoveryServices.WorkloadBackup.Edp  japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Security                             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Security.Edp                         japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Security.Test                        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.SiteRecovery.Test                    japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.SiteRecovery2.Test                   japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.Test.Identity                        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Azure.WindowsFabric.Test                   japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.AzureCAT.AzureEnhancedMonitoring           japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.AzureCAT.AzureEnhancedMonitoringTest       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.AzureSecurity.JITAccess                    japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.CloudBackup.Workload.Extension             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.CloudBackup.Workload.Extension.Edp         japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Compute                                    japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.CPlat.Core                                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.CPlat.Core.Edp                             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.DscPolicy.Test                             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.EnterpriseCloud.Monitoring                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.EnterpriseCloud.Monitoring.Test            japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Golive.Extensions                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.HDInsight.Current                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.HpcCompute                                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.HpcPack                                    japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.ManagedIdentity                            japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.OSTCExtensions                             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.OSTCExtensions.Edp                         japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.OSTCExtensions.Test                        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Powershell                                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Powershell.Test                            japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.SqlServer.Managability.IaaS.Test           japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.SqlServer.Management                       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.SystemCenter                               japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.TestSqlServer                              japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.TestSqlServer.Edp                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.VisualStudio.Azure.ETWTraceListenerService japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.VisualStudio.Azure.RemoteDebug             japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.VisualStudio.Azure.RemoteDebug.Json        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.VisualStudio.ServiceProfiler               japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.VisualStudio.Services                      japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Windows.AzureRemoteApp.Test                japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.Windows.RemoteDesktop                      japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Microsoft.WindowsAzure.Compute                       japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftAzureSiteRecovery                           japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftBizTalkServer                               japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftDynamicsAX                                  japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftDynamicsNAV                                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftHybridCloudStorage                          japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftOSTC                                        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftRServer                                     japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftSharePoint                                  japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftSQLServer                                   japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftVisualStudio                                japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftWindowsDesktop                              japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftWindowsServer                               japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftWindowsServerEssentials                     japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftWindowsServerHPCPack                        japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
MicrosoftWindowsServerRemoteDesktop                  japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Test.Microsoft.VisualStudio.Services                 japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...
Test3.Microsoft.VisualStudio.Services                japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/P...

```

#2. イメージプラン（Offer）の取得

```
Get-AzureRmVMImageOffer -Location "リージョン" -PublisherName "発行元"
sample) Get-AzureRmVMImageOffer -Location "japaneast" -PublisherName "MicrosoftWindowsServer"

Offer                   PublisherName          Location  Id
-----                   -------------          --------  --
Windows-HUB             MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/Provide...
WindowsServer           MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/Provide...
WindowsServerSemiAnnual MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42cf-91e6-0b08055aa3b3/Provide...

```

#3. イメージ名（Sku）の取得


```
Get-AzureRmVMImageSku -Location "リージョン" -PublisherName "発行元" -Offer "イメージプラン"
sample) Get-AzureRmVMImageSku -Location "japaneast" -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer"

Skus                                  Offer         PublisherName          Location  Id
----                                  -----         -------------          --------  --
2008-R2-SP1                           WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2008-R2-SP1-smalldisk                 WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2012-Datacenter                       WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2012-Datacenter-smalldisk             WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2012-R2-Datacenter                    WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2012-R2-Datacenter-smalldisk          WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter                       WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter-Server-Core           WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter-Server-Core-smalldisk WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter-smalldisk             WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter-with-Containers       WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Datacenter-with-RDSH             WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...
2016-Nano-Server                      WindowsServer MicrosoftWindowsServer japaneast /Subscriptions/ebeb0ffa-7afa-42...

```

これで必要な情報は取れましたね。
AzureCLIを利用する場合は、こちらを参照してください。

参考URL：https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/cli-ps-findimage