Skip to content

target port confusion #2461

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

Open
cforce opened this issue Mar 31, 2025 · 2 comments
Open

target port confusion #2461

cforce opened this issue Mar 31, 2025 · 2 comments

Comments

@cforce
Copy link
Contributor

cforce commented Mar 31, 2025

In received an error on deployment and checked param targetPort having distinct values. Is this coirrecvt?

web--hmof742  Activation failed The TargetPort 8000 does not match the listening port 80. Show logs unning status  Activation failed Status details The TargetPort 8000 does not match the listening port 80.

80 vs 8000 ?

targetPort: 8000

CMD ["python3", "-m", "gunicorn", "-b", "0.0.0.0:8000", "main:app"]

Image

related #2236

@pamelafox
Copy link
Collaborator

@cforce The 8000 in main.bicep should override targetPort in both container-app-upsert.bicep and container-app.bicep (main calls container-app-upsert which then calls container-app).
I see 8000 in my deployed app that is working, so that is what you should see as well.
I'm not sure why you would still see 80, did you make any change in the Bicep or Portal?

@cforce
Copy link
Contributor Author

cforce commented Apr 13, 2025

The aca container apps log streams says

Connecting...
2025-04-13T17:16:27.76906  Connecting to the container 'main'...
2025-04-13T17:16:27.80086  Successfully Connected to container: 'main' [Revision: 'capps-backend-jfnrv5kcsyxqa--zeb9nz5-6d694b59d8-958bc', Replica: 'capps-backend-jfnrv5kcsyxqa--zeb9nz5']
2025-04-13T17:13:21.6438490Z stderr F 2025/04/13 17:13:21 Listening on :80...

And the Ingress cfg says target port 8000- that does not make sense to me - can you explain?

How does container port and target port - aren't those the same?
And if , why do we use 80 as container port and not same values as in bicep - which is 8000

eLogs[0] {"Timestamp":"2025-04-13T17:35:27.4036752Z","SiteName":"","TaskName":"MiddlewareInformation","Message":"Disposing ModulesHostingConfigurationsService timer from old middleware version. Current: , Old: 1.10.3","ModuleRuntimeVersion":"","ProviderName":"Microsoft-Azure-AppService-Middleware","Level":4,"EventId":1}
2025-04-13 17:34:42,957 - INFO - Application startup complete.

2025-04-13 17:34:43,046 - INFO - Application startup complete.
warn: Microsoft.AspNetCore.Hosting.Diagnostics[15] Overriding HTTP_PORTS '8080' and HTTPS_PORTS ''. Binding to values defined by URLS instead 'http://0.0.0.0:1601'.
Middleware[0] Destination base URL is http://127.0.0.1
Microsoft.Hosting.Lifetime[14] Now listening on: http://0.0.0.0:1601
Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down.
Microsoft.Hosting.Lifetime[0] Hosting environment: Production
Microsoft.Hosting.Lifetime[0] Content root path: /app
warn: Microsoft.AspNetCore.Hosting.Diagnostics[15] Overriding HTTP_PORTS '8080' and HTTPS_PORTS ''. Binding to values defined by URLS instead 'http://0.0.0.0:1601'.
Middleware[0] Destination base URL is http://127.0.0.1
MiddlewareConsoleLogs[0] {"Timestamp":"2025-04-13T17:34:27.2760199Z","SiteName":"","TaskName":"TraceConfigurationSetting","ModuleRuntimeVersion":"","SettingName":"WEBSITE_AUTH_V2_CONFIG_JSON","SettingValue":"{\"platform\":{\"enabled\":true},\"globalValidation\":{\"unauthenticatedClientAction\":0,\"redirectToProvider\":\"azureactivedirectory\"},\"identityProviders\":{\"azureActiveDirectory\"

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

No branches or pull requests

2 participants