Skip to content

Export more importable ATS hosting APIs#15557

Open
sebastienros wants to merge 12 commits intorelease/13.2from
sebros/export-importable-apis
Open

Export more importable ATS hosting APIs#15557
sebastienros wants to merge 12 commits intorelease/13.2from
sebros/export-importable-apis

Conversation

@sebastienros
Copy link
Contributor

@sebastienros sebastienros commented Mar 24, 2026

Description

Expand the importable ATS/polyglot export surface across Aspire.Hosting, Aspire.Hosting.Azure, and Aspire.Hosting.Foundry.

  • convert compatible [AspireExportIgnore] APIs into importable ATS exports, including union- and DTO-based shims for overloads and flags enums
  • unify split ATS method names where the guest-language surface can share one logical API, including connection-property and Azure existing-resource helpers
  • update the TypeScript validation apphosts and checked-in generated SDKs to compile against the new exports
  • switch the checked-in polyglot validation apphosts to aspire.config.json and remove the legacy .aspire/settings.json files

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

sebastienros and others added 2 commits March 24, 2026 16:08
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

🚀 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://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15557

Or

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sebastienros and others added 2 commits March 25, 2026 07:17
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros marked this pull request as ready for review March 25, 2026 14:37
@sebastienros sebastienros requested a review from eerhardt as a code owner March 25, 2026 14:37
Copilot AI review requested due to automatic review settings March 25, 2026 14:37
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

Expands the importable ATS/polyglot export surface across Aspire.Hosting, Aspire.Hosting.Azure, and Aspire.Hosting.Foundry, and updates the TypeScript polyglot validation apphosts + checked-in generated SDK outputs to compile against the new exports (including moving validation apphosts to aspire.config.json).

Changes:

  • Adds union/DTO-based ATS-safe dispatcher exports (e.g., addContainer, withBuildArg, withConnectionProperty, withReferenceEnvironment) and new ATS DTOs.
  • Exports additional Azure/Foundry resource APIs to polyglot (including “existing resource” helpers and more resource/property exports).
  • Regenerates TypeScript validation apphosts’ .modules output and updates snapshots to reflect the new capability surface.

Reviewed changes

Copilot reviewed 81 out of 90 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/HostingContainerResourceCapabilities.verified.txt Updates TS codegen snapshot for newly exported/renamed capabilities (e.g., withBuildArg, withRelationship, withContainerCertificatePaths, withReferenceEnvironment).
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/HostingAddContainerCapability.verified.txt Updates snapshot for the polyglot addContainer union parameter and new source location.
src/Aspire.Hosting/ResourceBuilderExtensions.cs Adds ATS dispatcher exports for withConnectionProperty (union) and withReferenceEnvironment (DTO), and adds an exported withRelationship overload that accepts a resource builder.
src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs Exports AddProject(builder,name,projectPath) as addProjectWithoutLaunchProfile for polyglot.
src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs Adds/export an ATS-safe overload for generated parameter defaults (GenerateParameterDefault).
src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs Adds polyglot addContainer union overload and ATS dispatcher exports for withBuildArg and withContainerCertificatePaths.
src/Aspire.Hosting/Ats/ReferenceEnvironmentInjectionOptions.cs New ATS DTO for mapping environment injection options to flags.
src/Aspire.Hosting/Ats/AddContainerOptions.cs New ATS DTO for addContainer image configuration.
src/Aspire.Hosting/ApplicationModel/ParameterDefault.cs Marks GenerateParameterDefault as an ATS DTO.
src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs Adds exported polyglot shims for Foundry capability hosts and consolidates config creation/retrieval helpers.
src/Aspire.Hosting.Foundry/FoundryResource.cs Marks FoundryResource as exported.
src/Aspire.Hosting.Foundry/FoundryDeploymentResource.cs Makes Parent available to polyglot by removing ignore metadata.
src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs Reworks “existing resource” helpers into union-based polyglot exports and shared core implementations.
src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs Removes polyglot ignore annotations from additional output references and database dictionary exposure.
src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs Exports WithAdminDeploymentScriptSubnet to polyglot.
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusTopicResource.cs Makes Parent and ConnectionStringExpression available to polyglot.
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusSubscriptionResource.cs Makes Parent and ConnectionStringExpression available to polyglot.
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs Marks AzureServiceBusResource as exported.
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusQueueResource.cs Makes Parent and ConnectionStringExpression available to polyglot.
src/Aspire.Hosting.Azure.Redis/AzureManagedRedisResource.cs Makes NameOutputReference and Id available to polyglot.
src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkResource.cs Marks AzureVirtualNetworkResource as exported.
src/Aspire.Hosting.Azure.Network/AzureSubnetResource.cs Marks AzureSubnetResource as exported.
src/Aspire.Hosting.Azure.Kusto/AzureKustoHealthCheckBuilderExtensions.cs Clarifies export-ignore reason text.
src/Aspire.Hosting.Azure.Kusto/AzureKustoClusterResource.cs Makes additional output references available to polyglot.
src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsResource.cs Marks AzureEventHubsResource as exported.
src/Aspire.Hosting.Azure.EventHubs/AzureEventHubResource.cs Makes Parent and ConnectionStringExpression available to polyglot.
src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIResource.cs Marks AzureOpenAIResource as exported.
src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIDeploymentResource.cs Makes Parent and ConnectionStringExpression available to polyglot.
playground/polyglot/TypeScript/Aspire.Hosting/ValidationAppHost/aspire.config.json Migrates validation apphost to aspire.config.json schema with appHost object.
playground/polyglot/TypeScript/Aspire.Hosting/ValidationAppHost/apphost.ts Updates validation usage to new exports/unified methods (e.g., addContainer options, withConnectionProperty, withBuildArg, withReferenceEnvironment).
playground/polyglot/TypeScript/Aspire.Hosting/ValidationAppHost/.modules/base.ts Regenerated TS base module (cancellation + transport serialization changes, toTransportValue support).
playground/polyglot/TypeScript/Aspire.Hosting/ValidationAppHost/.modules/transport.ts Regenerated TS transport module (cancellation routing, circular ref detection, marshaling improvements, connection/auth flow).
playground/polyglot/TypeScript/Aspire.Hosting/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/aspire.config.json Adds aspire.config.json for Foundry validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/apphost.ts Updates Foundry validation to exercise new capability-host exports and additional parent/property getters.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/.modules/base.ts Regenerated TS base module for Foundry validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/.modules/transport.ts Regenerated TS transport module for Foundry validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Foundry/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure validation apphost (incl. profiles).
playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/apphost.ts Updates “existing resource” calls to new unified overload shape.
playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/.modules/transport.ts Regenerated TS transport module for Azure validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.Sql validation apphost (incl. Azure.Network/Azure.Storage packages).
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/apphost.ts Updates SQL validation to exercise newly exported subnet method + additional output refs/dictionaries.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.Sql validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/transport.ts Regenerated TS transport module for Azure.Sql validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.ServiceBus validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/apphost.ts Updates ServiceBus validation to exercise newly exported parent/connection-string expression getters.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.ServiceBus validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.Redis validation apphost (incl. KeyVault package).
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/apphost.ts Updates Redis validation to exercise newly exported output refs/ids.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.Redis validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.Kusto validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/apphost.ts Updates Kusto validation to exercise newly exported output refs.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.Kusto validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.EventHubs validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/apphost.ts Updates EventHubs validation to exercise newly exported parent/connection-string expression getters.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.EventHubs validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/aspire.config.json Adds aspire.config.json for Azure.CognitiveServices validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/apphost.ts Updates CognitiveServices validation to exercise newly exported deployment parent + connectionStringExpression.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/base.ts Regenerated TS base module for Azure.CognitiveServices validation apphost.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/.codegen-hash Updates generated hash.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.aspire/settings.json Removes legacy .aspire/settings.json.

sebastienros and others added 2 commits March 25, 2026 07:51
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
/// <param name="builder">The resource builder for the Microsoft Foundry project.</param>
/// <param name="openAI">The Microsoft Foundry resource builder.</param>
/// <returns>A reference to the project builder for chaining capability host configuration.</returns>
[AspireExportIgnore(Reason = "Use the polyglot withCapabilityHost overload instead.")]
Copy link
Member

Choose a reason for hiding this comment

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

Why do internal methods need AspireExportIgnore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. This was first added (un-ignored) then refactored to another pattern which made this obsolete. Since it's new it should just be removed instead..

@sebastienros
Copy link
Contributor Author

Re review 4007242739: declining this as an actionable comment because it is the review summary rather than a specific issue to address. I evaluated the concrete unresolved threads below and applied the warranted fixes there.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros
Copy link
Contributor Author

Reviewed the five comments called out in automation: 4007242739 is the Copilot review summary (informational only, so no code change); 2986149613/2988637945 were accepted and I pushed 1d18d71 to make the TypeScript DTO usage clearer in the validation apphost; 2988731875 and 2988731938 were already accepted earlier on the branch, and I verified both corresponding threads are already resolved with the fixes present in the current code.

sebastienros and others added 4 commits March 25, 2026 10:39
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@github-actions
Copy link
Contributor

🎬 CLI E2E Test Recordings — 51 recordings uploaded (commit 0ee559a)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23556540479

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