After creating a VM on Azure, I need to use a VPN in order to RDP to it. This is because of my Internet Service Provider's networking regulations. Therefore I have to change the RPD port from within the VM every time I create a new VM. Is there a way I can make the default RDP port number (ex: 8000) using Azure templates?
Asked
Active
Viewed 52 times
1 Answers
0
You can't make this change in an ARM template directly, as the port RDP listens on is an OS configuration rather than something at the VM level. There are a couple of things you can do:
- Use PowerShell DSC, or a custom PS script to change this. Have your ARM template call this script or DSC using the DSC or custom script extension.
- Setup the VM's behind a load balancer, which you can configure in an ARM template. Create NAT rules in the load balancer to forward your required port to the RDP port on the VM
![](../../users/profiles/48.webp)
Sam Cogan
- 38,158
- 6
- 77
- 113
-
Thanks for this great answer – Omar Obeid Jun 04 '20 at 13:01