-
Notifications
You must be signed in to change notification settings - Fork 619
[WebToolsE2E][Aspire] For a Function App with Aspire 9.2, the port number in console logs is always 7071 and does not match the port number in the dashboard #8589
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
Comments
Updated the Repro Steps with a MINIMAL REPRO as well. If you want to view the comparison with Aspire 9.1, see the DETAILED REPRO. @captainsafia fyi on this incoming issue related Function apps support. |
@balachir can you confirm whether or not the end-to-end still works using the port that is shown in the dashboard? (7045 in this case) It is of course an issue we'd want to fix anyway but we are trying to understand if this is something that is only incorrect in the console logs to see if we should block 9.2 on this. Also, does this repro in non-VS scenarios? |
FWIW, I believe @captainsafia just tried this locally in the CLI and it doesn't seem to repro for her. |
@joperezr the end-to-end does not work with the port that is shown in the dashboard (7045 in this case). It only works if you use the port that is shown in the console logs (7071). Using port 7071 For whether it works with the CLI, I'll try that later today and get back to you. |
@joperezr @captainsafia you're right. This does not reproduce for me if I try it using the CLI. Does it mean that this is a VS issue then? cc: @v-elenafeng |
Note: As described in my DETAILED REPRO in the Repro Steps above, even with VS 17.13, this issue only reproduces when the versions of Aspire.Hosting.AppHost and Aspire.Hosting.Azure.Functions are 9.2 and does not reproduce when the versions are 9.1. |
Interesting, @captainsafia I believe you did mention that VS has their own way of launching hence this would suggest an issue on their side, but what is weird is that using the exact same VS but with 9.1 packages instead the issue does not repro. Any clue on why this may be happening? |
@joperezr VS has its own implementation for how it launches the local Functions host when the user F5s that is independent of the Aspire implementation so I suspect something might've changed in that logic. We might be able to narrow this down by testing with different VS versions but I am not sure what versions we have access to. |
@captainsafia I have the required machines ready and have sent you a message in the Teams channel. |
@captainsafia @sebastienros here are some more updates to this item based on my investigation today. I can get this to reproduce with both VS 17.13 and VS 17.14, but it does not reproduce using CLI. Now, the interesting thing is that if I update only the Aspire.Hosting.AppHost package from 9.1.0 to 9.2.0, it still works fine. But as soon as I update the Aspire.Hosting.Azure.Functions package from 9.1.0-preview.1.25121.10 to 9.2.0-preview.1.25209.2, I can get this bug to repro when using VS. Hence, that seems to indicate that there's some change in Aspire.Hosting.Azure.Functions package in Aspire 9.2 that has made it incompatible with VS. So far, I'm not aware of any easy workaround for this issue in VS other than falling back to Aspire 9.1. |
Just to add, it's not enough to roll back Aspire.Hosting.Azure.Functions, All of Aspire has to go back to 9.1 |
And now it's working, I have no idea why! No changes showing in source control, but it now works fine, listening on the correct port 🤷♂️ |
I'm finding that I can run from Visual Studio and get the error. Then, stop and run again and no error. |
@JakeRadMSFT seems this is only broken when laucnhing from VS. Can you assign? |
Looking at the diff v9.1.0...v9.2.0 I can see two changes that look related to the topic: #7789 and #7683 (though this appears to have been applied to 9.1 as well). |
Yes, this is happening for me in both versions. |
Running into similar issues with trying to get multiple functions running in aspire in v9.2, I think I saw something odd when pouring over the changes. In #7789 file src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs Though I did seem to have success when keeping on v9.1-preview of the functions package. EDIT: Upon further investigation, the issue I seem to be encountering on 9.2 is that the first azure function started up seems fine, but the second one fails to start and dies with the following logs (project names edited): Working
Not working
Lemme know if I should pull this into a separate issue. |
Spent some time debugging this today, it appears that in 9.2, when DCP/AppHost invoke StartProjectAsync, the ProjectLaunchInfo.Arguments is null, whereas in 9.1, it is being set properly. This results in us using the default Functions port number (7071) when creating the launch arguments. This is consistent with this change: |
I have some additional information after further debugging, in the above referenced changes, it seems like the port is not null check below may be an issue.
If I rebuild this locally without the port is not null or skip over this in the debugger - things seem to work much better when a port is specified in the LaunchProfile, When testing without the port specified in the launch profile, we still get two different generated ports in the dashboard and console log, but they both work, both for the landing page and the API itself. Additionally, when specifying --useHttps in the launch profile with no port, I end up getting https: correctly in the dashboard, but it when the orchestrator evaluates endpoint reference expression, it doesn't take the scheme into account, as it launches the function app with http://. Also note, that the dashboard https link does not work, but does if you change the scheme to http: |
@danmoseley, based on the above, this seems like an issue with the Functions hosting package. |
Removing Tooling Area and @phenning for now. Feel free to pull us back in :) |
Thanks for these extra diagnostics that helps |
@mitchdenny are you the owner of next action here? need assignee probably |
I was looking at it but got side tracked with some blocking debugger attach issue. |
@captainsafia can you take a look at this tomorrow? |
I think we need to punt this to 9.4. I tried reverting the changes that were made to the Functions hosting package in 9.1 and none of them resulted in the desired behavior. I suspect something else changed in Aspire that is causing the issue. That might also explain why the CTI team is only reporting that it doesn't repro if all the Aspire packages are downgraded. |
As a workaround I've downgraded only Other Aspire packages I left on |
i have also encountered issues when upgrading to 9.2. I am getting the error "Value cannot be null. (Parameter 'provider')" for any function apps in aspire that have an HTTP triggered function. I ensured all packages inside Visual Studio and nuget packages were installed. |
@DavidPotter01 Can you file a separate issue for this? The bug you're describing seems like it might be related to not defining a |
My local.settings.json did not change with this update |
REGRESSION INFO
Worked in Aspire 9.1.0
INSTALL STEPS
MINIMAL REPRO
REPRO STEPS
ACTUAL
Port number in console logs is 7071 but the one shown in the dashboard is 7045
EXPECTED
Port number in console logs should match with the one in the dashboard -- both should be 7045
DETAILED REPRO (if you want to compare behavior with Aspire 9.1)
REPRO STEPS
With Aspire 9.1
With Aspire 9.2
ACTUAL
The URL (port number) shown in the Aspire dashboard does not match the port number used in the console logs
EXPECTED
The same port number should show up in the console logs as the dashboard URL. The page should load successfully as we saw with the Aspire 9.1 case above.
The text was updated successfully, but these errors were encountered: