- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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]
Advertisements