deployment-e2e-testing
Skill6.3k starsChanged 6 months agoMITView on GitHub
Guide for writing Aspire deployment end-to-end tests. Use this when asked to create, modify, or debug deployment E2E tests that deploy to Azure.
- Commits and pushes
Trending
Quiet since September.about the whole repository
Who's talking about microsoft/aspire
- Azure/azure-functions-core-tools“azure-functions-core-tools 4.13.2 Linux x64 package references a missing CDN blob”GitHub · Aug 9, 2026 · 18 reactions
- apple/container“[Request]: `cp` command tar stream support”GitHub · Jul 6, 2026 · 6 reactions
- CommunityToolkit/Aspire“Add Dekaf Kafka client integration and Schema Registry hosting support”GitHub · Sep 21, 2026 · 2 reactions
- thomhurst/TUnit“chore(deps): update aspire to 13.5.2”GitHub · Aug 21, 2026 · 2 reactions
- kubernetes-client/csharp“UnobservedTaskException from orphaned ReadLineAsync task in Watcher<T>.CreateWatchEventEnumerator during …”GitHub · Jun 22, 2026 · 2 reactions
The biggest 5 of 20 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 20
Talked about on GitHub and Bluesky (20 times).
On GitHub · 18
- Aug 9, 2026azure-functions-core-tools 4.13.2 Linux x64 package references a missing CDN blob — Azure/azure-functions-core-tools18 reactions · 11 comments
- Jul 6, 2026[Request]: `cp` command tar stream support — apple/container6 reactions · 2 comments
- Sep 21, 2026Add Dekaf Kafka client integration and Schema Registry hosting support — CommunityToolkit/Aspire2 reactions
- Aug 21, 2026chore(deps): update aspire to 13.5.2 — thomhurst/TUnit2 reactions · 3 comments
- Jun 22, 2026UnobservedTaskException from orphaned ReadLineAsync task in Watcher<T>.CreateWatchEventEnumerator during cancellation — kubernetes-client/csharp2 reactions · 2 comments
13 more on GitHub
- Jun 17, 2026chore(deps): update aspire monorepo to 13.4.5 — chrismeller/archiveteam-exporter2 reactions
- Jun 11, 2026chore(deps): update aspire monorepo to 13.4.3 — chrismeller/archiveteam-exporter2 reactions · 1 comment
- May 19, 2026chore(deps): update aspire monorepo to 13.3.4 — chrismeller/archiveteam-exporter2 reactions
- Sep 26, 2026Update Aspire version to 13.6.0 Staging Channel — CommunityToolkit/Aspire1 reaction · 5 comments
- Sep 8, 2026This PR merges the `release/13.5` branch back to `main` after the v13.5.0 release. — cli/cli1 reaction · 1 comment
- Aug 24, 2026Azure.Provisioning.AppContainers uses incorrect default naming requirements for managed environments — Azure/azure-sdk-for-net1 reaction
- Aug 6, 2026safe-outputs checkout auto-detection downgrades contents: write to read — github/gh-aw1 reaction
- Jun 15, 2026deps: Update aspire monorepo to 13.4.6 — ANcpLua/DotNetTests1 reaction
- May 26, 2026safe_outputs add_comment hard-fails on locked source PR (pr-docs-check recurring failures) — github/gh-aw1 reaction
- May 24, 2026"Install the Aspire Templates" section should be clear it's referring specifically to `dotnet` — microsoft/aspire.dev1 reaction · 1 comment
- May 13, 2026Azure.Provisioning.ContainerService: ManagedClusterIngressProfile is internal, blocking preview-API gatewayAPI and applicationLoadBalancer additions — Azure/azure-sdk-for-net1 reaction · 3 comments
- May 12, 2026Application Insights is filled with EventProcessor.Process logs that cannot be filtered out when OpenTelemetry enabled — Azure/azure-functions-host1 reaction
- Apr 16, 2026End2End template with Foundry Hosted Agents — leslierichardson95/aspire-agent-template1 reaction · 3 comments
On Bluesky · 2
- Mar 23, 2026.NET Aspireはコードファーストで拡張性のある分散アプリ開発を統一的に支援するツール群らしい コードでサービスやリソースを定義してローカルデバッグからデプロイまでこなせるのが便利そうかな yug1224 starred microsoft/aspire… — @yug1224.com1 likes and repost
- Mar 22, 2026📦 microsoft / aspire ⭐ 5,662 (+72) 🗒 TypeScript Aspire is the tool for code-first, extensible, observable dev and deploy. — @github-trending-js.bsky.social1 likes and repost
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-reviewSkill
- azdo-internalSkill
- backport-prSkill
- bump-aspire-versionSkill
- ci-test-failuresSkill
- cli-channel-debuggingSkill
- cli-e2e-testingSkill
- code-reviewSkill
- connection-propertiesSkill
- create-prSkill
- dashboard-testingSkill
- dependency-updateSkill
- deprecate-integrationSkill
- fix-flaky-testSkill
- hex1bSkill
- hosting-integration-authoringSkill
- issue-investigationSkill
- pr-testingSkill
- reviewing-aspire-architectureSkill
- startup-perfSkill
- test-managementSkill
- update-container-imagesSkill
- vscode-extensionSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 265
Always cleanup Azure resources in a finally block:
- Distinctive: line 400
Local: Ensure Azure CLI is authenticated:
- Distinctive: line 406
CI: Check OIDC configuration:
- Distinctive: line 414
Check the asciinema recording for where it stopped
- Distinctive: line 416
Check Azure portal for deployment status
- Distinctive: line 434
Create new App Registration in new tenant
- Very specific: line 437
Update GitHub secrets: AZURE_DEPLOYMENT_TEST_CLIENT_ID, AZURE_DEPLOYMENT_TEST_TENANT_ID, AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Aspire Deployment End-to-End Testing
This skill provides patterns and practices for writing end-to-end tests that deploy Aspire applications to real Azure infrastructure.
Overview
Deployment E2E tests extend the CLI E2E testing patterns with actual Azure deployments. They use the Hex1b terminal automation library to drive the Aspire CLI and verify that deployed applications work correctly.
Location: tests/Aspire.Deployment.EndToEnd.Tests/
Supported Platforms: Linux only (Hex1b requirement).
Prerequisites:
- Azure subscription with appropriate permissions
- OIDC authentication (CI) or Azure CLI authentication (local)
Relationship to CLI E2E Tests
Deployment tests build on the CLI E2E testing skill. Before working with deployment tests, familiarize yourself with:
- CLI E2E Testing Skill - Core terminal automation patterns
Key differences from CLI E2E tests:
| Aspect | CLI E2E Tests | Deployment E2E Tests |
| Duration | 5-15 minutes | 15-45 minutes |
| Resources | Local only | Azure resources |
| Authentication | None | Azure OIDC/CLI |
| Cleanup | Temp directories | Azure resource groups |
| Triggers | PR, push | Nightly, manual, deploy-test/* |
Key Components
Core Classes
DeploymentE2ETestHelpers(Helpers/DeploymentE2ETestHelpers.cs): Terminal factory and environment helpersDeploymentE2EAutomatorHelpers(Helpers/DeploymentE2EAutomatorHelpers.cs): Async extension methods onHex1bTerminalAutomatorfor deployment scenariosHex1bAutomatorTestHelpers(shared): Common async extension methods onHex1bTerminalAutomator(WaitForSuccessPromptAsync,AspireNewAsync, etc.)AzureAuthenticationHelpers(Helpers/AzureAuthenticationHelpers.cs): Azure auth and resource namingDeploymentReporter(Helpers/DeploymentReporter.cs): GitHub step summary reportingSequenceCounter(Helpers/SequenceCounter.cs): Prompt tracking (same as CLI E2E)
Test Architecture
Each deployment test:
- Validates Azure authentication (skip if not available locally)
- Generates a unique resource group name
- Creates a project using
aspire new - Deploys using
aspire deploy - Verifies deployed endpoints work
- Reports results to GitHub step summary
- Cleans up Azure resources
Test Structure
public sealed class MyDeploymentTests(ITestOutputHelper output)
{
[Fact]
public async Task DeployMyScenario()
{
// 1. Validate prerequisites
var subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();
if (string.IsNullOrEmpty(subscriptionId))
{
Assert.Skip("Azure subscription not configured.");
}
if (!AzureAuthenticationHelpers.IsAzureAuthAvailable())
{
if (DeploymentE2ETestHelpers.IsRunningInCI)
{
Assert.Fail("Azure auth not available in CI.");
}
Assert.Skip("Azure auth not available. Run 'az login'.");
}
// 2. Setup
var resourceGroupName = AzureAuthenticationHelpers.GenerateResourceGroupName("my-scenario");
var workspace = TemporaryWorkspace.Create(output);
var startTime = DateTime.UtcNow;
try
{
// 3. Build terminal and run deployment
using var terminal = DeploymentE2ETestHelpers.CreateTestTerminal();
var pendingRun = terminal.RunAsync(TestContext.Current.CancellationToken);
var counter = new SequenceCounter();
var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
await auto.PrepareEnvironmentAsync(workspace, counter);
if (DeploymentE2ETestHelpers.IsRunningInCI)
{
await auto.SourceAspireCliEnvironmentAsync(counter);
}
await auto.AspireNewAsync("MyProject", counter, useRedisCache: false);
// ... deployment steps ...
await auto.TypeAsync("exit");
await auto.EnterAsync();
await pendingRun;
// 4. Report success
var duration = DateTime.UtcNow - startTime;
DeploymentReporter.ReportDeploymentSuccess(
nameof(DeployMyScenario),
resourceGroupName,
deploymentUrls,
duration);
}
catch (Exception ex)
{
DeploymentReporter.ReportDeploymentFailure(
nameof(DeployMyScenario),
resourceGroupName,
ex.Message);
throw;
}
finally
{
// 5. Cleanup Azure resources
await CleanupResourceGroupAsync(resourceGroupName);
}
}
}Extension Methods
DeploymentE2EAutomatorHelpers Extensions on Hex1bTerminalAutomator
| Method | Description |
PrepareEnvironmentAsync(workspace, counter) | Sets up the terminal environment with custom prompt and workspace directory |
InstallAspireCliFromPullRequestAsync(prNumber, counter) | Downloads and installs the Aspire CLI from a PR build artifact |
InstallAspireCliReleaseAsync(counter) | Installs the latest released Aspire CLI |
SourceAspireCliEnvironmentAsync(counter) | Adds ~/.aspire/bin to PATH so the aspire command is available |
These extend Hex1bTerminalAutomator and are used alongside the shared Hex1bAutomatorTestHelpers methods (WaitForSuccessPromptAsync, AspireNewAsync, etc.) documented in the CLI E2E Testing Skill.
Azure Authentication
In CI (GitHub Actions)
Tests use OIDC (Workload Identity Federation) for authentication:
- name: Azure Login (OIDC)
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ vars.ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION }}The test code automatically detects CI and uses DefaultAzureCredential which picks up the OIDC session.
Local Development
Authenticate with Azure CLI before running tests:
# Login to Azure
az login
# Set your subscription
az account set --subscription "your-subscription-id"
# Set environment variable
export ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION="your-subscription-id"
# Run tests
dotnet test tests/Aspire.Deployment.EndToEnd.Tests/Authentication Helpers
// Check if auth is available
if (!AzureAuthenticationHelpers.IsAzureAuthAvailable())
{
Assert.Skip("Azure auth not available");
}
// Get subscription ID
var subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();
// Generate unique resource group name
var rgName = AzureAuthenticationHelpers.GenerateResourceGroupName("my-test");
// Result: "aspire-e2e-my-test-20240115-abc12345"
// Check auth type
if (AzureAuthenticationHelpers.IsOidcConfigured())
{
// Using OIDC (CI)
}
else
{
// Using Azure CLI (local)
}Resource Group Naming
Resource groups are named with a consistent pattern for easy identification and cleanup:
{prefix}-{testname}-{date}-{runid}Example: aspire-e2e-aca-starter-20240115-12345678
Components:
- prefix: From
ASPIRE_DEPLOYMENT_TEST_RG_PREFIX(default:aspire-e2e) - testname: Sanitized test name (lowercase, alphanumeric, hyphens)
- date: UTC date in YYYYMMDD format
- runid: GitHub run ID or random GUID suffix
Reporting Results
GitHub Step Summary
Tests automatically write to the GitHub step summary:
// Report success with URLs
DeploymentReporter.ReportDeploymentSuccess(
testName: "DeployStarterToACA",
resourceGroupName: "aspire-e2e-...",
deploymentUrls: new Dictionary<string, string>
{
["Dashboard"] = "https://dashboard.azurecontainerapps.io",
["Web Frontend"] = "https://webfrontend.azurecontainerapps.io"
},
duration: TimeSpan.FromMinutes(15));
// Report failure
DeploymentReporter.ReportDeploymentFailure(
testName: "DeployStarterToACA",
resourceGroupName: "aspire-e2e-...",
errorMessage: "Deployment timed out",
logs: "Full deployment logs...");Asciinema Recordings
Tests generate recordings for debugging:
var recordingPath = DeploymentE2ETestHelpers.GetTestResultsRecordingPath(nameof(MyTest));
// CI: $GITHUB_WORKSPACE/testresults/recordings/MyTest.cast
// Local: /tmp/aspire-deployment-e2e/recordings/MyTest.castCleanup
Always cleanup Azure resources in a finally block:
private static async Task CleanupResourceGroupAsync(string resourceGroupName)
{
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "az",
Arguments = $"group delete --name {resourceGroupName} --yes --no-wait",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false
}
};
process.Start();
await process.WaitForExitAsync();
if (process.ExitCode != 0)
{
var error = await process.StandardError.ReadToEndAsync();
throw new InvalidOperationException($"Cleanup failed: {error}");
}
}Workflow Triggers
Deployment tests are triggered by:
- Nightly schedule (03:00 UTC) - Runs on
main - Manual dispatch - Via GitHub Actions UI
- Push to
deploy-test/*- For rapid iteration
Iterating on Tests
To iterate quickly during development:
# Create a protected branch
git checkout -b deploy-test/my-feature
# Make changes
# ...
# Push to trigger workflow
git push origin deploy-test/my-featureEnvironment Variables
| Variable | Required | Description |
ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION | Yes | Azure subscription ID |
ASPIRE_DEPLOYMENT_TEST_RG_PREFIX | No | Resource group prefix (default: aspire-e2e) |
AZURE_DEPLOYMENT_TEST_TENANT_ID | CI | Azure AD tenant ID (GitHub secret) |
AZURE_DEPLOYMENT_TEST_CLIENT_ID | CI | OIDC app client ID (GitHub secret) |
AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID | CI | Azure subscription ID (GitHub secret) |
DO: Always Validate Prerequisites
var subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();
if (string.IsNullOrEmpty(subscriptionId))
{
Assert.Skip("Subscription not configured");
}
if (!AzureAuthenticationHelpers.IsAzureAuthAvailable())
{
Assert.Skip("Azure auth not available");
}DO: Generate Unique Resource Groups
var rgName = AzureAuthenticationHelpers.GenerateResourceGroupName("my-test");DO: Report to GitHub Summary
DeploymentReporter.ReportDeploymentSuccess(...);
// or
DeploymentReporter.ReportDeploymentFailure(...);DO: Always Cleanup Resources
try
{
// ... deployment test ...
}
finally
{
await CleanupResourceGroupAsync(resourceGroupName);
}DON'T: Hardcode Subscription IDs
// DON'T
var subscriptionId = "12345-abcde-...";
// DO
var subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();DON'T: Skip Cleanup on Failure
// DON'T - cleanup might not run
await DeployAsync();
await CleanupAsync(); // Skipped if deploy throws!
// DO - always cleanup
try
{
await DeployAsync();
}
finally
{
await CleanupAsync(); // Always runs
}Troubleshooting
Authentication Failures
Local: Ensure Azure CLI is authenticated:
az login
az account showCI: Check OIDC configuration:
AZURE_CLIENT_IDsecret is setAZURE_TENANT_IDsecret is set- Workload Identity Federation is configured in Azure AD
Deployment Timeouts
Deployments can take 15-30+ minutes. If tests timeout:
- Check the asciinema recording for where it stopped
- Increase timeout in
WaitUntilcalls - Check Azure portal for deployment status
Orphaned Resources
Find and cleanup orphaned test resources:
# List all test resource groups
az group list --query "[?starts_with(name, 'aspire-e2e')]" -o table
# Delete specific resource group
az group delete --name aspire-e2e-xxx --yesTenant Rotation
The test tenant rotates every ~90 days. When rotation occurs:
- Create new App Registration in new tenant
- Configure Workload Identity Federation for the
deployment-testingenvironment - Grant Owner role on subscription (constrained - cannot create other Owner identities)
- Update GitHub secrets:
AZURE_DEPLOYMENT_TEST_CLIENT_ID,AZURE_DEPLOYMENT_TEST_TENANT_ID,AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

