Accessing Your System
Learning to troubleshoot your workloads will help you in your daily job. Troubleshooting in Azure is not different from doing so in other environments. In this section, we are going to see some tips and tricks that will help you in your daily job.
No Remote Access
When you don't have access to your Azure VM via SSH, you can run commands via the Azure portal.
To run a command on your Azure VM from the Azure portal, log in to your Azure portal, navigate to your VM and select Run Command:
Figure 11.3: Navigating to the VM section within the Azure portal
Alternatively, you can use the command line, as follows:
az vm run-command invoke --name <vm name> \ Â Â --command-id RunShellScript \ Â Â --scripts hostnamectl \ Â Â --resource-group <resource group>
The az vm run
command can be used to run shell scripts in your VM for general machine or application management and to diagnose issues...