Search code examples
amazon-web-servicesazurecloud

Is there a CLI command on Azure to see console messages of a VM that is not booting up?


On AWS, the CLI command to see console messages that let you know what problems the VM is having an issue at boot time is:

aws ec2 get-console-output --instance-id

Is there any similar command in Azure?

Thank you!


Solution

  • Yes, Azure provides a similar way to view the boot diagnostics logs of a VM that is not booting up. You can use Azure CLI -

    to get the boot diagnostic logs

    az vm boot-diagnostics get-boot-log --resource-group <ResourceGroupName> --name <VMName>
    

    enter image description here

    but before that you need to enable boot diagnostics

    az vm boot-diagnostics enable --resource-group <ResourceGroupName> --name <VMName> --storage <StorageAccountName>
    

    Reference link for CLI- az vm boot-diagnostics | Microsoft Learn