Azure / dev-spaces

Azure Dev Spaces is retired, please use Bridge to Kubernetes.
MIT License
136 stars 306 forks source link

Ability to configure the local port(s) being forwarded when debugging in Visual Studio #270

Open Chipzter opened 4 years ago

Chipzter commented 4 years ago

Is your feature request related to a problem? Please describe. Due to NSG rules in our AKS clusters, We need to access the debugged service using the port forwarded from localhost. Additionally, we need to use the same local port every time since the host:port combination needs to be the same as in the registered reply URL in AAD. This can be achieved in VS Code by adding the --port option to the "azds: prelaunch" task in tasks.json, but I cannot find any way of achieving the same thing in Visual Studio which is a bit of a blocker for those in our teams who prefer the Visual Studio IDE.

Describe the solution you'd like I want to be able to specify local port(s) to forward in the project debug options in the project properties screen in Visual Studio.

Describe alternatives you've considered One work-around is to manually run kubectl port-forward every time you start a new debugging session. This works, but it's a hassle.

dbreshears commented 4 years ago

@Chipzter , confirmed that we currently do not allow specifying the local port and not sure there is any other workaround in the VS tooling. We will investigate giving the ability to specify the port in a future VS update. thanks!

ahaeber commented 4 years ago

@dbreshears please consider adding this support to the azds client so it can also be leveraged in other environments (e.g., working CLI-only or other IDEs) than VS. For example allow specifying ports in azds.yaml or parameters to azds up.

rakeshvanga commented 4 years ago

@ahaeber, On CLI, you can specify a local port for the port forwarding for azds up command. Copying the help text here but you can find more information by running azds up --help.

 -p|--port              Ports from the dev space workload to expose locally using the format --port <local1>:<remote1> --port <local2>:<remote2>
ahaeber commented 4 years ago

Thanks, that's great! Wish I noticed that earlier :-)

BR, Andreas

On Fri, Apr 3, 2020, 19:08 rakeshvanga notifications@github.com wrote:

@ahaeber https://github.com/ahaeber, On CLI, you can specify a local port for the port forwarding for azds up command. Copying the help text here but you can find more information by running azds up --help.

-p|--port Ports from the dev space workload to expose locally using the format --port : --port :

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/dev-spaces/issues/270#issuecomment-608556150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGPLAHU6JBRGTMZVUTFNMLRKYJ2NANCNFSM4KLSJKHQ .