Skip to content

Conversation

@eerhardt
Copy link
Member

Need to check for publish mode before calling GetValueAsync on the URL parameter

Fix #10789

eerhardt added 2 commits July 31, 2025 17:45
Need to check for publish mode before calling GetValueAsync on the URL parameter

Fix dotnet#10789
@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 22:56
@eerhardt eerhardt requested a review from mitchdenny as a code owner July 31, 2025 22:56
@eerhardt eerhardt requested a review from DamianEdwards July 31, 2025 22:56
@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jul 31, 2025
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 fixes an issue where external services with URL parameters fail to generate manifests in publish mode. The fix addresses the problem by checking the execution mode before attempting to resolve parameter values during manifest generation.

Key changes:

  • Added a check for publish mode before calling GetValueAsync on URL parameters
  • Created a test case to verify manifest generation works correctly for external services with parameters
  • Updated the validation logic to only validate URL parameters when not in publish mode

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Hosting/ResourceBuilderExtensions.cs Fixed the validation logic to check publish mode before resolving URL parameter values
tests/Aspire.Hosting.Tests/ExternalServiceTests.cs Added test case to verify external services with parameters generate manifests correctly in publish mode
tests/Aspire.Hosting.Tests/Snapshots/ExternalServiceTests.ExternalServiceWithParameterPublishManifest.verified.json Snapshot file for the new test case showing expected manifest output

@davidfowl davidfowl merged commit bc97b33 into dotnet:main Aug 1, 2025
276 checks passed
@eerhardt eerhardt deleted the Fix10789 branch August 1, 2025 14:48
@eerhardt
Copy link
Member Author

eerhardt commented Aug 1, 2025

/backport to release/9.4

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2025

@davidfowl davidfowl added this to the 9.5 milestone Aug 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azd init fails when External Service Parameter has no default value and configuration key is missing

3 participants