Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asp.net with Angular dev tunnel returns 404 #497

Open
gitHubUser151 opened this issue Nov 12, 2024 · 7 comments
Open

Asp.net with Angular dev tunnel returns 404 #497

gitHubUser151 opened this issue Nov 12, 2024 · 7 comments

Comments

@gitHubUser151
Copy link

A project created in a template asp.net with angular.
Dev tunnel creates only one port. When the SPA project is ready it is redirected to the new port. Normally here the angular app would show up. However after redirected, it returns 404 error 'page can't be found'.
When I check dev tunnel, there is only one port, which is the initial while SPA is not ready yet.

@derekbekoe
Copy link
Contributor

Hi @gitHubUser151 - Can you add more details outlining your scenario and the expected behavior here?
How many ports are you expecting to be there on the tunnel?
Also, if you have the tunnel id available, along with a timestamp, we can take a look at our telemetry.

@gitHubUser151
Copy link
Author

Sure, I'm here to help while using ngrok))

Here is the normal behavior without dev tunnel:

  1. On F5 the local host starts on port 7245:
    Image

  2. Once SPA proxy is ready, it automatically redirected to port 44476. And the app works from this new port as usual:
    Image

Now will do the same with dev tunnel.

  1. First port 7245 gets launched:
    Image

  2. Once the SPA proxy is ready, it gets redirected to port 44476:
    Image

We can see that there is only one channel was created for port 7245. And this is the problem.
Image

Time of launch is 12:53 PM Turkey time zone, 13 November. Not sure how to retrieve the timestamp.

Dev Tunnels during test:
https://localhost:7245 -> https://zhhxnj80-7245.euw.devtunnels.ms/
https://localhost:7245 -> https://8rflcxbs-7245.euw.devtunnels.ms/
https://localhost:7245 -> https://vf30p0jx-7245.euw.devtunnels.ms/

Let me know if any more is required

@derekbekoe
Copy link
Contributor

Thanks for the details.
Port 44476 can be added via the "Dev Tunnels" pane in VS.
This would allow that port to also be made available on the tunnel.

@gitHubUser151
Copy link
Author

Sure, could you please send some screenshots on how to add the port to the tunnel?
I could not find how to do it. Therefore created this issue.

@derekbekoe
Copy link
Contributor

In the Tools Window, there should be a "+" button. I believe that should allow you to add a port.
https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-8.0#dev-tunnels-tool-window

@gitHubUser151
Copy link
Author

Derek,
Thanks for the answer. The '+' button adds a new dev tunnel, not a port.
Currently I don't see the way to add a new port to existing tunnel, nor assign a specific port to a new dev tunnel.

@derekbekoe
Copy link
Contributor

Another option is to use the devtunnel CLI to host both ports simultaneously.
Documentation on hosting is available at https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/cli-commands#host-a-dev-tunnel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants