「az login」でAzureにログインして、「az vm show」で仮想マシンを確認する。
「-o」でフォーマット変更可能。例)-o tsv ※デフォルトはjson形式
「--query」でプロパティの限定可能。例)--query vmId
> az login
> az vm show -g [Resource-Group-Name] -n [VM-Name]
実際に実行してみます。
> az vm show -g fortigate_group -n fortigate
{
"additionalCapabilities": null,
"availabilitySet": null,
"billingProfile": null,
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": null
}
},
"evictionPolicy": null,
"extensionsTimeBudget": null,
"hardwareProfile": {
"vmSize": "Standard_B2s"
},
"host": null,
"hostGroup": null,
"id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/fortigate_group/providers/Microsoft.Compute/virtualMachines/fortigate",
"identity": null,
"instanceView": null,
"licenseType": null,
"location": "japaneast",
"name": "fortigate",
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/fortigate_group/providers/Microsoft.Network/networkInterfaces/fortigate829",
"primary": null,
"resourceGroup": "fortigate_group"
}
]
},
"osProfile": {
"adminPassword": null,
"adminUsername": "xxxxxxxx",
"allowExtensionOperations": true,
"computerName": "fortigate",
"customData": null,
"linuxConfiguration": {
"disablePasswordAuthentication": false,
"patchSettings": {
"patchMode": "ImageDefault"
},
"provisionVmAgent": true,
"ssh": null
},
"requireGuestProvisionSignal": true,
"secrets": [],
"windowsConfiguration": null
},
"plan": {
"name": "fortinet_fg-vm_payg_20190624",
"product": "fortinet_fortigate-vm_v5",
"promotionCode": null,
"publisher": "fortinet"
},
"priority": null,
"provisioningState": "Succeeded",
"proximityPlacementGroup": null,
"resourceGroup": "fortigate_group",
"resources": null,
"securityProfile": null,
"storageProfile": {
"dataDisks": [],
"imageReference": {
"exactVersion": "6.4.3",
"id": null,
"offer": "fortinet_fortigate-vm_v5",
"publisher": "fortinet",
"sku": "fortinet_fg-vm_payg_20190624",
"version": "latest"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"diffDiskSettings": null,
"diskSizeGb": 2,
"encryptionSettings": null,
"image": null,
"managedDisk": {
"diskEncryptionSet": null,
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/fortigate_group/providers/Microsoft.Compute/disks/fortigate_OsDisk_1_b4e74c564dbe4b51886d170a1102bbdf",
"resourceGroup": "fortigate_group",
"storageAccountType": "Premium_LRS"
},
"name": "fortigate_OsDisk_1_b4e74c564dbe4b51886d170a1102bbdf",
"osType": "Linux",
"vhd": null,
"writeAcceleratorEnabled": null
}
},
"tags": null,
"type": "Microsoft.Compute/virtualMachines",
"virtualMachineScaleSet": null,
"vmId": "b0e611ec-b692-448e-96c8-08452eb05904",
"zones": [
"1"
]
}