Sometimes you’re hired by a company which is a bit rigorous on blocking outgoing communication. A security consultant would probably agree on this practice, but most developers won’t. Nowadays a lot of services in the cloud operate on different ports. Azure services don’t always operate on port 80 and 443, hosted noSQL providers have connection strings with (seemingly) random ports, etc. It’s not always easy to get approval to open ports in the company firewall, especially if you’re doing some tests and proof of concept projects. A way to get around this policy is to create a virtual machine in Azure.

When you choose to create a new virtual machine from the gallery you can create an image with Visual Studio pre-installed on it. Even the latest versions are available!

image

After completing the wizard you’ll have to wait a few minutes for the machine to spin up.

Don’t be happy just yet. When you try to connect to the machine, you’ll probably get a timeout or some other connection problem. This is because the configured RDP port is probably also blocked by your company firewall. A way to fix this is to set the public RDP port to 80 or 443 (which company would block normal HTTP(S) traffic?). This setting can be configured on the Endpoints tab of the virtual machine.

image

After doing so you will be able to log in to your virtual machine and start working on your cloud project.

If you know up front which ports are open/free, you can also configure this setting when creating the virtual machine. On step 3 in the wizard you will be prompted to configure some settings. Just change the public port from AUTO to 443 and you will be able to RDP when the machine spinned up.

image

Please note I don’t advice to use this method for real production development. If you need ports to be open during the development period, please ask your system administrator to do so. Company policies exist for a reason (well, I assume they do).

comments powered by Disqus