
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to retrieve the Azure VM nic name using Azure CLI in PowerShell?
To get the Azure VM NIC name using Azure CLI, use the below command but before running the command make sure that you are connected to the Azure Account and the proper Azure subscription using Azure CLI.
az vm show -n AzureVM -g ResourceGroup --query '[networkProfile.networkInterfaces][].id' -otsv
We need the NIC name from this. If you are running the Azure CLI in the PowerShell terminal then use the command below.
PS C:\> $nicinfo = az vm show -n VMname -g RGName --query '[networkProfile.networkInterfaces][].id' -otsv PS C:\> ($nicinfo.Split('/'))[-1]
- Related Questions & Answers
- How to retrieve the Azure VM NIC name using PowerShell?
- How to retrieve the OS of the Azure VM using Azure CLI in PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- How to resize the Azure VM using Azure CLI in PowerShell?
- How to retrieve the Azure VM vNet name using PowerShell?
- How to retrieve the Azure VM Subscription Name using PowerShell?
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to get the Azure VM username using Azure CLI in PowerShell?
- How to list the azure VM extensions using Azure CLI in PowerShell?
- How to get the available azure VM size using Azure CLI in PowerShell?
- How to open port for the Azure VM using Azure CLI in PowerShell?
- How to get the location of the Azure VM using Azure CLI in PowerShell?
Advertisements