Skip to content

Add E2E deployment test for React + ASP.NET Core to Azure App Service#14326

Merged
davidfowl merged 21 commits intomainfrom
deploy-test/appservice-react
Feb 4, 2026
Merged

Add E2E deployment test for React + ASP.NET Core to Azure App Service#14326
davidfowl merged 21 commits intomainfrom
deploy-test/appservice-react

Conversation

@mitchdenny
Copy link
Member

Summary

This PR adds a new end-to-end deployment test that validates deploying a React + ASP.NET Core application to Azure App Service.

What's new

  • New test file: AppServiceReactDeploymentTests.cs
  • Template used: Starter App (ASP.NET Core/React)
  • Deployment target: Azure App Service (instead of Container Apps)

Test details

The test follows the established patterns from AcaStarterDeploymentTests and PythonFastApiDeploymentTests:

  1. Creates a new project using aspire new with the React template
  2. Adds Aspire.Hosting.Azure.AppService package
  3. Modifies AppHost.cs to use AddAzureAppServiceEnvironment("infra")
  4. Deploys using aspire deploy
  5. Verifies endpoints using az webapp list

Key differences from Container Apps tests

Aspect Container Apps App Service
Package Aspire.Hosting.Azure.AppContainers Aspire.Hosting.Azure.AppService
Environment AddAzureContainerAppEnvironment AddAzureAppServiceEnvironment
Endpoint verification az containerapp list az webapp list
Timeout 15-20 min 25 min

Testing

The deploy-test/* branch pattern will automatically trigger the deployment workflow to validate this test.

This adds a new deployment test that:
- Creates a project using the Starter App (ASP.NET Core/React) template
- Deploys to Azure App Service (instead of Container Apps)
- Verifies the deployed endpoints are accessible

The test follows the established patterns from AcaStarterDeploymentTests
and PythonFastApiDeploymentTests.
Copilot AI review requested due to automatic review settings February 3, 2026 23:41
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 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 -- 14326

Or

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

@mitchdenny
Copy link
Member Author

/deployment-test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

🚀 Starting deployment tests on PR #14326...

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

View workflow run

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 that validates deploying a React + ASP.NET Core application to Azure App Service, complementing existing tests for Azure Container Apps deployments.

Changes:

  • Adds AppServiceReactDeploymentTests.cs with a comprehensive E2E test for Azure App Service deployment
  • Follows established patterns from AcaStarterDeploymentTests and PythonFastApiDeploymentTests
  • Uses the React template with Aspire.Hosting.Azure.AppService package and AddAzureAppServiceEnvironment API

"failed=0 && " +
"for url in $urls; do " +
"echo -n \"Checking https://$url... \"; " +
"STATUS=$(curl -s -o /dev/null -w \"%{http_code}\" \"https://$url\" --max-time 30 2>/dev/null); " +
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The curl timeout is set to 30 seconds here, while the similar tests AcaStarterDeploymentTests.cs (line 229) and PythonFastApiDeploymentTests.cs (line 223) use 10 seconds. If App Service endpoints require more time to respond than Container Apps, this deviation should be explained in a comment. Otherwise, consider using the same 10-second timeout for consistency across the test suite.

Suggested change
"STATUS=$(curl -s -o /dev/null -w \"%{http_code}\" \"https://$url\" --max-time 30 2>/dev/null); " +
"STATUS=$(curl -s -o /dev/null -w \"%{http_code}\" \"https://$url\" --max-time 10 2>/dev/null); " +

Copilot uses AI. Check for mistakes.
The React template (aspire-ts-cs-starter) has different prompts than the
Blazor starter template:
- Does NOT have a 'test project' prompt
- Output path prompt includes the default path

Updated to match the working JsReactTemplateTests pattern.
@mitchdenny
Copy link
Member Author

/deployment-test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🚀 Starting deployment tests on PR #14326...

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

View workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Deployment E2E Tests failed

One or more deployment tests failed. Check the workflow run for details.

View workflow run

🎬 Terminal Recordings

Test Recording
DeployPythonFastApiTemplateToAzureContainerApps ▶️ View Recording
DeployReactTemplateToAzureAppService ▶️ View Recording
DeployStarterTemplateToAzureContainerApps ▶️ View Recording

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 16b3265:

Test Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording

📹 Recordings uploaded automatically from CI run #21666390803

Mitch Denny added 2 commits February 4, 2026 11:23
- Increase pipeline wait timeout from 10-20 min to 30 min across all deployment tests
- Increase overall test timeout to 40 min to accommodate longer deployments
- Fix cleanup workflow to target both e2e-* (current) and rg-aspire-* (legacy) prefixes
Each endpoint is now retried up to 18 times (10 second intervals) for a total
of ~3 minutes before failing. This handles cases where deployed apps need
time to become responsive after deployment completes.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Deployment E2E Tests failed

One or more deployment tests failed. Check the workflow run for details.

View workflow run

🎬 Terminal Recordings

Test Recording
DeployPythonFastApiTemplateToAzureContainerApps ▶️ View Recording
DeployReactTemplateToAzureAppService ▶️ View Recording
DeployStarterTemplateToAzureContainerApps ▶️ View Recording

@mitchdenny
Copy link
Member Author

/deployment-test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🚀 Starting deployment tests on PR #14326...

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

View workflow run

The NuGet.config prompt behavior is inconsistent in CI - sometimes it appears
interactively, sometimes it auto-accepts. Updated tests to:
1. Wait 5 seconds after running aspire init
2. Press Enter (dismisses prompt if present, no-op if auto-accepted)
3. Then wait for 'Aspire initialization complete'

This handles both interactive and non-interactive cases.
Azure resources that require role assignments (Storage, KeyVault, AppConfig,
ServiceBus, EventHubs) need a managed identity principal. The Container App
Environment provides this. Updated 5 failing tests to include:
  builder.AddAzureContainerAppEnvironment("env")

This provides the principal required for provisioning role assignments.
Mitch Denny added 6 commits February 4, 2026 16:22
AddAzureContainerAppEnvironment() requires the ContainerApps hosting package.
Updated 5 tests to add this package before adding the specific Azure resource
package. Flow is now:
1. aspire init
2. aspire add Aspire.Hosting.Azure.ContainerApps
3. aspire add Aspire.Hosting.Azure.{Resource}
4. modify apphost.cs to use AddAzureContainerAppEnvironment + AddAzure{Resource}
Add pattern searcher for 'Select an integration to add:' prompt
and wait for it before pressing Enter to select the first match.
This handles the fuzzy matching that shows multiple options.
aspire add may show either:
- Integration selection prompt if multiple matches
- Version selection prompt if unique match

The combined searcher waits for either prompt type.
aspire add Aspire.Hosting.Azure.ContainerApps triggers:
1. Integration selection prompt (matches multiple Azure packages)
2. Version selection prompt (in CI)

Need to wait for and handle both prompts sequentially.
- Use discard pattern (_) instead of unused variable for AddAzureContainerAppEnvironment
- Update README.md Test Structure section to include new Azure resource test files
App Service provisioning takes longer than 30 minutes, causing test
timeouts. Skipped until infrastructure issues are resolved.
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.

3 participants