Skip to content

Add TypeScript Express/React deployment E2E test and template updates#14967

Merged
davidfowl merged 8 commits intorelease/13.2from
davidfowl/ts-deployment-test
Mar 5, 2026
Merged

Add TypeScript Express/React deployment E2E test and template updates#14967
davidfowl merged 8 commits intorelease/13.2from
davidfowl/ts-deployment-test

Conversation

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented Mar 5, 2026

Description

Add a TypeScript Express/React deployment E2E test and update the ts-starter template for deployment readiness.

Changes:

  1. TypeScript deployment E2E test (TypeScriptExpressDeploymentTests.cs) — follows the same pattern as PythonFastApiDeploymentTests:

    • Creates a project via aspire new (Express/React template)
    • Adds Aspire.Hosting.Azure.AppContainers via aspire add
    • Modifies apphost.ts to add addAzureContainerAppEnvironment
    • Deploys to Azure Container Apps via aspire deploy
    • Verifies deployed endpoints return 200/302
  2. Template updates for deployment support:

    • apphost.ts: Renamed resource from api to app for consistency with Python template. Capture frontend variable and add await app.publishWithContainerFiles(frontend, "./static") so the Vite frontend build output is bundled into the Express API container during publish. Added withExternalHttpEndpoints() so the API is publicly accessible when deployed.
    • api/src/index.ts: Serve static files from ./static directory when present (deploy mode), using import.meta.dirname (Node 22+)
  3. Export PublishWithContainerFiles for polyglot apphosts — Added [AspireExport] attribute to ResourceBuilderExtensions.PublishWithContainerFiles so TypeScript/Python apphosts can use it via ATS codegen. This exposes the existing public API to the polyglot SDK generation pipeline.

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?

Add TypeScriptExpressDeploymentTests that deploys the ts-starter template to Azure Container Apps. Also:
- Export PublishWithContainerFiles via [AspireExport] for polyglot apphost usage
- Update Express API template to serve static files from ./static directory when present (deploy mode)

The deployment bundles the Vite frontend into the Express API container via publishWithContainerFiles, matching the pattern used by the Python FastAPI template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 5, 2026 05:27
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14967

Or

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

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 new end-to-end deployment test for TypeScript Express/React applications and updates the ts-starter template to support deployment via Azure Container Apps. It also exports PublishWithContainerFiles for use by polyglot (TypeScript/Python) apphosts through the [AspireExport] attribute.

Changes:

  1. New TypeScriptExpressDeploymentTests.cs E2E test that creates a project from the Express/React template, adds Azure Container Apps hosting, deploys, and verifies endpoints — closely following the existing PythonFastApiDeploymentTests pattern.
  2. Template updates: apphost.ts captures the frontend variable and calls publishWithContainerFiles to bundle Vite build output into the Express container; api/src/index.ts serves static files from a ./static directory when present.
  3. [AspireExport] attribute added to PublishWithContainerFiles to make it available to TypeScript/Python apphosts via codegen.

Reviewed changes

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

File Description
tests/Aspire.Deployment.EndToEnd.Tests/TypeScriptExpressDeploymentTests.cs New E2E deployment test for TypeScript Express/React template, following established patterns
src/Aspire.Hosting/ResourceBuilderExtensions.cs Adds [AspireExport] attribute to PublishWithContainerFiles for polyglot apphost codegen
src/Aspire.Cli/Templating/Templates/ts-starter/apphost.ts Template update: captures frontend builder and calls publishWithContainerFiles to bundle static assets
src/Aspire.Cli/Templating/Templates/ts-starter/api/src/index.ts Serves static files from ./static directory when present (for deploy mode)

davidfowl and others added 4 commits March 4, 2026 21:42
The API endpoint needs to be marked as external so it gets
exposed publicly when deployed (Docker Compose or ACA).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ython template

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Node 22 supports import.meta.dirname natively, removing the
need for the fileURLToPath/dirname workaround.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The [AspireExport] attribute on PublishWithContainerFiles causes
the method and IContainerFilesDestinationResource type to appear
in the TwoPassScanning codegen output for all languages.

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

github-actions bot commented Mar 5, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 20c9a48:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AgentInitCommand_WithMalformedMcpJson_ShowsErrorAndExitsNonZero ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ 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
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ❌ Upload failed
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ❌ Upload failed
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22707857569

@davidfowl
Copy link
Contributor Author

/deployment-test

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

🚀 Deployment tests starting on PR #14967...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot had a problem deploying to deployment-testing March 5, 2026 06:57 Failure
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 5, 2026 06:57 Inactive
The apphost names the resource 'app', so the environment variables
injected by Aspire are APP_HTTP/APP_HTTPS, not API_HTTP/API_HTTPS.

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

github-actions bot commented Mar 5, 2026

Deployment E2E Tests failed

Summary: 25 passed, 1 failed, 0 cancelled

View workflow run

Passed Tests

  • ✅ Deployment.EndToEnd-VnetKeyVaultInfraDeploymentTests
  • ✅ Deployment.EndToEnd-VnetKeyVaultConnectivityDeploymentTests
  • ✅ Deployment.EndToEnd-VnetSqlServerInfraDeploymentTests
  • ✅ Deployment.EndToEnd-AzureServiceBusDeploymentTests
  • ✅ Deployment.EndToEnd-AzureLogAnalyticsDeploymentTests
  • ✅ Deployment.EndToEnd-AppServicePythonDeploymentTests
  • ✅ Deployment.EndToEnd-AksStarterWithRedisDeploymentTests
  • ✅ Deployment.EndToEnd-AppServiceReactDeploymentTests
  • ✅ Deployment.EndToEnd-PythonFastApiDeploymentTests
  • ✅ Deployment.EndToEnd-AuthenticationTests
  • ✅ Deployment.EndToEnd-AzureStorageDeploymentTests
  • ✅ Deployment.EndToEnd-AcaCompactNamingDeploymentTests
  • ✅ Deployment.EndToEnd-AksStarterDeploymentTests
  • ✅ Deployment.EndToEnd-AzureKeyVaultDeploymentTests
  • ✅ Deployment.EndToEnd-AzureContainerRegistryDeploymentTests
  • ✅ Deployment.EndToEnd-AcaDeploymentErrorOutputTests
  • ✅ Deployment.EndToEnd-AzureAppConfigDeploymentTests
  • ✅ Deployment.EndToEnd-AcaStarterDeploymentTests
  • ✅ Deployment.EndToEnd-AcaExistingRegistryDeploymentTests
  • ✅ Deployment.EndToEnd-AcrPurgeTaskDeploymentTests
  • ✅ Deployment.EndToEnd-AzureEventHubsDeploymentTests
  • ✅ Deployment.EndToEnd-VnetStorageBlobConnectivityDeploymentTests
  • ✅ Deployment.EndToEnd-AcaCompactNamingUpgradeDeploymentTests
  • ✅ Deployment.EndToEnd-VnetStorageBlobInfraDeploymentTests
  • ✅ Deployment.EndToEnd-AcaCustomRegistryDeploymentTests

Failed Tests

  • ❌ Deployment.EndToEnd-TypeScriptExpressDeploymentTests

🎬 Terminal Recordings

Test Recording
DeployAzureAppConfigResourceCore ▶️ View Recording
DeployAzureContainerRegistryResourceCore ▶️ View Recording
DeployAzureEventHubsResourceCore ▶️ View Recording
DeployAzureKeyVaultResourceCore ▶️ View Recording
DeployAzureLogAnalyticsResourceCore ▶️ View Recording
DeployAzureServiceBusResourceCore ▶️ View Recording
DeployAzureStorageResourceCore ▶️ View Recording
DeployPythonFastApiTemplateToAzureAppServiceCore ▶️ View Recording
DeployPythonFastApiTemplateToAzureContainerAppsCore ▶️ View Recording
DeployPythonStarterWithPurgeTaskCore ▶️ View Recording
DeployReactTemplateToAzureAppServiceCore ▶️ View Recording
DeployStarterTemplateToAksCore ▶️ View Recording
DeployStarterTemplateToAzureContainerAppsCore ▶️ View Recording
DeployStarterTemplateWithCustomRegistryCore ▶️ View Recording
DeployStarterTemplateWithExistingRegistryCore ▶️ View Recording
DeployStarterTemplateWithKeyVaultPrivateEndpointCore ▶️ View Recording
DeployStarterTemplateWithRedisToAksCore ▶️ View Recording
DeployStarterTemplateWithStorageBlobPrivateEndpointCore ▶️ View Recording
DeployTypeScriptExpressTemplateToAzureContainerAppsCore ▶️ View Recording
DeployVnetKeyVaultInfrastructureCore ▶️ View Recording
DeployVnetSqlServerInfrastructureCore ▶️ View Recording
DeployVnetStorageBlobInfrastructureCore ▶️ View Recording
DeployWithCompactNamingFixesStorageCollisionCore ▶️ View Recording
DeployWithInvalidLocation_ErrorOutputIsCleanCore ▶️ View Recording
UpgradeFromGaToDevDoesNotDuplicateStorageAccountsCore ▶️ View Recording

When aspire new resolves a version from an explicit channel (e.g. local,
daily), persist the channel name in .aspire/settings.json so that
subsequent aspire add commands use the same channel without prompting.

Implicit channels (stable/nuget.org) are not written, keeping the
default behavior.

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

/deployment-test

1 similar comment
@davidfowl
Copy link
Contributor Author

/deployment-test

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Deployment E2E Tests failed

Summary: 25 passed, 1 failed, 0 cancelled

View workflow run

Passed Tests

  • ✅ Deployment.EndToEnd-AcaCompactNamingDeploymentTests
  • ✅ Deployment.EndToEnd-VnetKeyVaultInfraDeploymentTests
  • ✅ Deployment.EndToEnd-VnetSqlServerInfraDeploymentTests
  • ✅ Deployment.EndToEnd-AzureStorageDeploymentTests
  • ✅ Deployment.EndToEnd-VnetKeyVaultConnectivityDeploymentTests
  • ✅ Deployment.EndToEnd-PythonFastApiDeploymentTests
  • ✅ Deployment.EndToEnd-AzureServiceBusDeploymentTests
  • ✅ Deployment.EndToEnd-AzureLogAnalyticsDeploymentTests
  • ✅ Deployment.EndToEnd-AzureEventHubsDeploymentTests
  • ✅ Deployment.EndToEnd-AzureContainerRegistryDeploymentTests
  • ✅ Deployment.EndToEnd-AzureKeyVaultDeploymentTests
  • ✅ Deployment.EndToEnd-AzureAppConfigDeploymentTests
  • ✅ Deployment.EndToEnd-AuthenticationTests
  • ✅ Deployment.EndToEnd-AppServiceReactDeploymentTests
  • ✅ Deployment.EndToEnd-AppServicePythonDeploymentTests
  • ✅ Deployment.EndToEnd-AcrPurgeTaskDeploymentTests
  • ✅ Deployment.EndToEnd-AksStarterWithRedisDeploymentTests
  • ✅ Deployment.EndToEnd-AcaDeploymentErrorOutputTests
  • ✅ Deployment.EndToEnd-AcaStarterDeploymentTests
  • ✅ Deployment.EndToEnd-VnetStorageBlobConnectivityDeploymentTests
  • ✅ Deployment.EndToEnd-AksStarterDeploymentTests
  • ✅ Deployment.EndToEnd-AcaCompactNamingUpgradeDeploymentTests
  • ✅ Deployment.EndToEnd-AcaExistingRegistryDeploymentTests
  • ✅ Deployment.EndToEnd-AcaCustomRegistryDeploymentTests
  • ✅ Deployment.EndToEnd-VnetStorageBlobInfraDeploymentTests

Failed Tests

  • ❌ Deployment.EndToEnd-TypeScriptExpressDeploymentTests

🎬 Terminal Recordings

Test Recording
DeployAzureAppConfigResourceCore ▶️ View Recording
DeployAzureContainerRegistryResourceCore ▶️ View Recording
DeployAzureEventHubsResourceCore ▶️ View Recording
DeployAzureKeyVaultResourceCore ▶️ View Recording
DeployAzureLogAnalyticsResourceCore ▶️ View Recording
DeployAzureServiceBusResourceCore ▶️ View Recording
DeployAzureStorageResourceCore ▶️ View Recording
DeployPythonFastApiTemplateToAzureAppServiceCore ▶️ View Recording
DeployPythonFastApiTemplateToAzureContainerAppsCore ▶️ View Recording
DeployPythonStarterWithPurgeTaskCore ▶️ View Recording
DeployReactTemplateToAzureAppServiceCore ▶️ View Recording
DeployStarterTemplateToAksCore ▶️ View Recording
DeployStarterTemplateToAzureContainerAppsCore ▶️ View Recording
DeployStarterTemplateWithCustomRegistryCore ▶️ View Recording
DeployStarterTemplateWithExistingRegistryCore ▶️ View Recording
DeployStarterTemplateWithKeyVaultPrivateEndpointCore ▶️ View Recording
DeployStarterTemplateWithRedisToAksCore ▶️ View Recording
DeployStarterTemplateWithStorageBlobPrivateEndpointCore ▶️ View Recording
DeployTypeScriptExpressTemplateToAzureContainerAppsCore ▶️ View Recording
DeployVnetKeyVaultInfrastructureCore ▶️ View Recording
DeployVnetSqlServerInfrastructureCore ▶️ View Recording
DeployVnetStorageBlobInfrastructureCore ▶️ View Recording
DeployWithCompactNamingFixesStorageCollisionCore ▶️ View Recording
DeployWithInvalidLocation_ErrorOutputIsCleanCore ▶️ View Recording
UpgradeFromGaToDevDoesNotDuplicateStorageAccountsCore ▶️ View Recording

@mitchdenny
Copy link
Member

/deployment-test TypeScriptExpressDeploymentTests

/// <param name="builder">The resource builder to which container files will be copied to.</param>
/// <param name="source">The resource which contains the container files to be copied.</param>
/// <param name="destinationPath">The destination path within the resource's container where the files will be copied.</param>
[AspireExport("publishWithContainerFiles", Description = "Configures the resource to copy container files from the specified source during publishing")]
Copy link
Member

Choose a reason for hiding this comment

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

@sebastienros - when is the Description on this annotation ever different from the summary of the XML docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is something we're likely going to remove once we figure out the doc comment story.

@eerhardt
Copy link
Member

eerhardt commented Mar 5, 2026

The failure is:

❌ An error occurred while adding the package: No Aspire AppHost server is available. Ensure the Aspire CLI is installed with a valid bundle layout, or reinstall using 'aspire setup --force'.

@davidfowl davidfowl merged commit 21bd8c1 into release/13.2 Mar 5, 2026
385 checks passed
@davidfowl davidfowl deleted the davidfowl/ts-deployment-test branch March 5, 2026 16:57
@davidfowl
Copy link
Contributor Author

Yea I tried, to re-run it. I'll test it manually and open a new PR if there are any issues.

@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 5, 2026
eerhardt pushed a commit to eerhardt/aspire that referenced this pull request Mar 7, 2026
…microsoft#14967)

* Add TypeScript Express/React deployment E2E test

Add TypeScriptExpressDeploymentTests that deploys the ts-starter template to Azure Container Apps. Also:
- Export PublishWithContainerFiles via [AspireExport] for polyglot apphost usage
- Update Express API template to serve static files from ./static directory when present (deploy mode)

The deployment bundles the Vite frontend into the Express API container via publishWithContainerFiles, matching the pattern used by the Python FastAPI template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add withExternalHttpEndpoints to ts-starter template

The API endpoint needs to be marked as external so it gets
exposed publicly when deployed (Docker Compose or ACA).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename ts-starter resource from 'api' to 'app' for consistency with Python template

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify static file imports using import.meta.dirname

Node 22 supports import.meta.dirname natively, removing the
need for the fileURLToPath/dirname workaround.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add await to publishWithContainerFiles call in template

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update codegen snapshots for PublishWithContainerFiles export

The [AspireExport] attribute on PublishWithContainerFiles causes
the method and IContainerFilesDestinationResource type to appear
in the TwoPassScanning codegen output for all languages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix React template env vars to match resource name

The apphost names the resource 'app', so the environment variables
injected by Aspire are APP_HTTP/APP_HTTPS, not API_HTTP/API_HTTPS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Write channel to settings.json during aspire new for CLI templates

When aspire new resolves a version from an explicit channel (e.g. local,
daily), persist the channel name in .aspire/settings.json so that
subsequent aspire add commands use the same channel without prompting.

Implicit channels (stable/nuget.org) are not written, keeping the
default behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Mitch Denny <mitch@mitchdeny.com>
Copilot AI pushed a commit that referenced this pull request Mar 10, 2026
…#14967)

* Add TypeScript Express/React deployment E2E test

Add TypeScriptExpressDeploymentTests that deploys the ts-starter template to Azure Container Apps. Also:
- Export PublishWithContainerFiles via [AspireExport] for polyglot apphost usage
- Update Express API template to serve static files from ./static directory when present (deploy mode)

The deployment bundles the Vite frontend into the Express API container via publishWithContainerFiles, matching the pattern used by the Python FastAPI template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add withExternalHttpEndpoints to ts-starter template

The API endpoint needs to be marked as external so it gets
exposed publicly when deployed (Docker Compose or ACA).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename ts-starter resource from 'api' to 'app' for consistency with Python template

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify static file imports using import.meta.dirname

Node 22 supports import.meta.dirname natively, removing the
need for the fileURLToPath/dirname workaround.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add await to publishWithContainerFiles call in template

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update codegen snapshots for PublishWithContainerFiles export

The [AspireExport] attribute on PublishWithContainerFiles causes
the method and IContainerFilesDestinationResource type to appear
in the TwoPassScanning codegen output for all languages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix React template env vars to match resource name

The apphost names the resource 'app', so the environment variables
injected by Aspire are APP_HTTP/APP_HTTPS, not API_HTTP/API_HTTPS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Write channel to settings.json during aspire new for CLI templates

When aspire new resolves a version from an explicit channel (e.g. local,
daily), persist the channel name in .aspire/settings.json so that
subsequent aspire add commands use the same channel without prompting.

Implicit channels (stable/nuget.org) are not written, keeping the
default behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Mitch Denny <mitch@mitchdeny.com>
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.

5 participants