
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Open Port for Azure VM Using Azure CLI in PowerShell
To open the specific port for the Azure VM using Azure CLI, we can use az vm open-port command. Before running this command, make sure that you are connected with the Azure Cloud account and the proper Azure subscription.
To open port 80 we can use the below command.
az vm open-port -n Win2k16VM1 -g testvmrg --port 80
The above command will open port 80 on the VM win2k16vm1 and the resource group testvmrg.
To open the port with the highest priority, you can add the --priority parameter
az vm open-port -n Win2k16VM1 -g testvmrg --port 80 --priority 100
To open the port range,
az vm open-port -n Win2k16VM1 -g testvmrg --port 80-100 --priority 100
The above command will open ports 80 to 100 with the highest priority.
If you have multiple ports to open then,
PS C:\> az vm open-port -n Win2k16VM1 -g testvmrg --port 300, 330-400
The above command will open ports 300 and 330 to 400 on the Azure VM.
Advertisements