az vm boot-diagnostics

Troubleshoot the startup of an Azure Virtual Machine.

Use this feature to troubleshoot boot failures for custom or platform images.

Commands

az vm boot-diagnostics disable Disable the boot diagnostics on a VM.
az vm boot-diagnostics enable Enable the boot diagnostics on a VM.
az vm boot-diagnostics get-boot-log Get the boot diagnostics log from a VM.

az vm boot-diagnostics disable

Disable the boot diagnostics on a VM.

az vm boot-diagnostics disable [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Disable boot diagnostics on all VMs in a resource group.

az vm boot-diagnostics disable --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Disable the boot diagnostics on a VM

az vm boot-diagnostics disable --ids $(az vm list --resource-group MyResourceGroup --query "[].id" -o tsv) --name MyVirtualMachine --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az vm boot-diagnostics enable

Enable the boot diagnostics on a VM.

az vm boot-diagnostics enable --storage
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Enable boot diagnostics on all VMs in a resource group.

az vm boot-diagnostics enable --storage https://mystor.blob.core.windows.net/ --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Enable the boot diagnostics on a VM. (autogenerated)

az vm boot-diagnostics enable --name MyVirtualMachine --resource-group MyResourceGroup --storage https://mystor.blob.core.windows.net/

Required Parameters

--storage

Name or URI of a storage account (e.g. https://your_storage_account_name.blob.core.windows.net/).

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az vm boot-diagnostics get-boot-log

Get the boot diagnostics log from a VM.

az vm boot-diagnostics get-boot-log [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Get diagnostics logs for all VMs in a resource group.

az vm boot-diagnostics get-boot-log --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Get the boot diagnostics log from a VM. (autogenerated)

az vm boot-diagnostics get-boot-log --name MyVirtualMachine --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.