[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FKXYT26Q3N771Q8T2KE5B5":3,"skill-same:01M6FKXYT26Q3N771Q8T2KE5B5":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6FKXYT26Q3N771Q8T2KE5B5","deployment-e2e-testing",null,"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.","microsoft\u002Faspire","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6FKTZ7ND1S9JN6JTVK7A7MD",6426,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdeployment-e2e-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"e2e testing","deployment e2e testing","deployment","testing","e2e","create","when","for","debug deployment","end","tests","use","guide","e2e tests","azure","aspire deployment","aspire","debug","deploy","writing","2026-11-10 10:12:30",false,"---\nname: deployment-e2e-testing\ndescription: 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.\n---\n\n# Aspire Deployment End-to-End Testing\n\nThis skill provides patterns and practices for writing end-to-end tests that deploy Aspire applications to real Azure infrastructure.\n\n## Overview\n\nDeployment 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.\n\n**Location**: `tests\u002FAspire.Deployment.EndToEnd.Tests\u002F`\n\n**Supported Platforms**: Linux only (Hex1b requirement).\n\n**Prerequisites**:\n- Azure subscription with appropriate permissions\n- OIDC authentication (CI) or Azure CLI authentication (local)\n\n## Relationship to CLI E2E Tests\n\nDeployment tests build on the CLI E2E testing skill. Before working with deployment tests, familiarize yourself with:\n\n- [CLI E2E Testing Skill](..\u002Fcli-e2e-testing\u002FSKILL.md) - Core terminal automation patterns\n\nKey differences from CLI E2E tests:\n\n| Aspect | CLI E2E Tests | Deployment E2E Tests |\n|--------|---------------|----------------------|\n| Duration | 5-15 minutes | 15-45 minutes |\n| Resources | Local only | Azure resources |\n| Authentication | None | Azure OIDC\u002FCLI |\n| Cleanup | Temp directories | Azure resource groups |\n| Triggers | PR, push | Nightly, manual, deploy-test\u002F* |\n\n## Key Components\n\n### Core Classes\n\n- **`DeploymentE2ETestHelpers`** (`Helpers\u002FDeploymentE2ETestHelpers.cs`): Terminal factory and environment helpers\n- **`DeploymentE2EAutomatorHelpers`** (`Helpers\u002FDeploymentE2EAutomatorHelpers.cs`): Async extension methods on `Hex1bTerminalAutomator` for deployment scenarios\n- **`Hex1bAutomatorTestHelpers`** (shared): Common async extension methods on `Hex1bTerminalAutomator` (`WaitForSuccessPromptAsync`, `AspireNewAsync`, etc.)\n- **`AzureAuthenticationHelpers`** (`Helpers\u002FAzureAuthenticationHelpers.cs`): Azure auth and resource naming\n- **`DeploymentReporter`** (`Helpers\u002FDeploymentReporter.cs`): GitHub step summary reporting\n- **`SequenceCounter`** (`Helpers\u002FSequenceCounter.cs`): Prompt tracking (same as CLI E2E)\n\n### Test Architecture\n\nEach deployment test:\n\n1. Validates Azure authentication (skip if not available locally)\n2. Generates a unique resource group name\n3. Creates a project using `aspire new`\n4. Deploys using `aspire deploy`\n5. Verifies deployed endpoints work\n6. Reports results to GitHub step summary\n7. Cleans up Azure resources\n\n## Test Structure\n\n```csharp\npublic sealed class MyDeploymentTests(ITestOutputHelper output)\n{\n    [Fact]\n    public async Task DeployMyScenario()\n    {\n        \u002F\u002F 1. Validate prerequisites\n        var subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();\n        if (string.IsNullOrEmpty(subscriptionId))\n        {\n            Assert.Skip(\"Azure subscription not configured.\");\n        }\n\n        if (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n        {\n            if (DeploymentE2ETestHelpers.IsRunningInCI)\n            {\n                Assert.Fail(\"Azure auth not available in CI.\");\n            }\n            Assert.Skip(\"Azure auth not available. Run 'az login'.\");\n        }\n\n        \u002F\u002F 2. Setup\n        var resourceGroupName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-scenario\");\n        var workspace = TemporaryWorkspace.Create(output);\n        var startTime = DateTime.UtcNow;\n\n        try\n        {\n            \u002F\u002F 3. Build terminal and run deployment\n            using var terminal = DeploymentE2ETestHelpers.CreateTestTerminal();\n            var pendingRun = terminal.RunAsync(TestContext.Current.CancellationToken);\n\n            var counter = new SequenceCounter();\n            var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));\n\n            await auto.PrepareEnvironmentAsync(workspace, counter);\n            if (DeploymentE2ETestHelpers.IsRunningInCI)\n            {\n                await auto.SourceAspireCliEnvironmentAsync(counter);\n            }\n            await auto.AspireNewAsync(\"MyProject\", counter, useRedisCache: false);\n            \u002F\u002F ... deployment steps ...\n\n            await auto.TypeAsync(\"exit\");\n            await auto.EnterAsync();\n            await pendingRun;\n\n            \u002F\u002F 4. Report success\n            var duration = DateTime.UtcNow - startTime;\n            DeploymentReporter.ReportDeploymentSuccess(\n                nameof(DeployMyScenario),\n                resourceGroupName,\n                deploymentUrls,\n                duration);\n        }\n        catch (Exception ex)\n        {\n            DeploymentReporter.ReportDeploymentFailure(\n                nameof(DeployMyScenario),\n                resourceGroupName,\n                ex.Message);\n            throw;\n        }\n        finally\n        {\n            \u002F\u002F 5. Cleanup Azure resources\n            await CleanupResourceGroupAsync(resourceGroupName);\n        }\n    }\n}\n```\n\n## Extension Methods\n\n### DeploymentE2EAutomatorHelpers Extensions on Hex1bTerminalAutomator\n\n| Method | Description |\n|--------|-------------|\n| `PrepareEnvironmentAsync(workspace, counter)` | Sets up the terminal environment with custom prompt and workspace directory |\n| `InstallAspireCliFromPullRequestAsync(prNumber, counter)` | Downloads and installs the Aspire CLI from a PR build artifact |\n| `InstallAspireCliReleaseAsync(counter)` | Installs the latest released Aspire CLI |\n| `SourceAspireCliEnvironmentAsync(counter)` | Adds `~\u002F.aspire\u002Fbin` to PATH so the `aspire` command is available |\n\nThese extend `Hex1bTerminalAutomator` and are used alongside the shared `Hex1bAutomatorTestHelpers` methods (`WaitForSuccessPromptAsync`, `AspireNewAsync`, etc.) documented in the [CLI E2E Testing Skill](..\u002Fcli-e2e-testing\u002FSKILL.md).\n\n## Azure Authentication\n\n### In CI (GitHub Actions)\n\nTests use OIDC (Workload Identity Federation) for authentication:\n\n```yaml\n- name: Azure Login (OIDC)\n  uses: azure\u002Flogin@v2\n  with:\n    client-id: ${{ secrets.AZURE_CLIENT_ID }}\n    tenant-id: ${{ secrets.AZURE_TENANT_ID }}\n    subscription-id: ${{ vars.ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION }}\n```\n\nThe test code automatically detects CI and uses `DefaultAzureCredential` which picks up the OIDC session.\n\n### Local Development\n\nAuthenticate with Azure CLI before running tests:\n\n```bash\n# Login to Azure\naz login\n\n# Set your subscription\naz account set --subscription \"your-subscription-id\"\n\n# Set environment variable\nexport ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION=\"your-subscription-id\"\n\n# Run tests\ndotnet test tests\u002FAspire.Deployment.EndToEnd.Tests\u002F\n```\n\n### Authentication Helpers\n\n```csharp\n\u002F\u002F Check if auth is available\nif (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n{\n    Assert.Skip(\"Azure auth not available\");\n}\n\n\u002F\u002F Get subscription ID\nvar subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();\n\n\u002F\u002F Generate unique resource group name\nvar rgName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-test\");\n\u002F\u002F Result: \"aspire-e2e-my-test-20240115-abc12345\"\n\n\u002F\u002F Check auth type\nif (AzureAuthenticationHelpers.IsOidcConfigured())\n{\n    \u002F\u002F Using OIDC (CI)\n}\nelse\n{\n    \u002F\u002F Using Azure CLI (local)\n}\n```\n\n## Resource Group Naming\n\nResource groups are named with a consistent pattern for easy identification and cleanup:\n\n```\n{prefix}-{testname}-{date}-{runid}\n```\n\nExample: `aspire-e2e-aca-starter-20240115-12345678`\n\nComponents:\n- **prefix**: From `ASPIRE_DEPLOYMENT_TEST_RG_PREFIX` (default: `aspire-e2e`)\n- **testname**: Sanitized test name (lowercase, alphanumeric, hyphens)\n- **date**: UTC date in YYYYMMDD format\n- **runid**: GitHub run ID or random GUID suffix\n\n## Reporting Results\n\n### GitHub Step Summary\n\nTests automatically write to the GitHub step summary:\n\n```csharp\n\u002F\u002F Report success with URLs\nDeploymentReporter.ReportDeploymentSuccess(\n    testName: \"DeployStarterToACA\",\n    resourceGroupName: \"aspire-e2e-...\",\n    deploymentUrls: new Dictionary\u003Cstring, string>\n    {\n        [\"Dashboard\"] = \"https:\u002F\u002Fdashboard.azurecontainerapps.io\",\n        [\"Web Frontend\"] = \"https:\u002F\u002Fwebfrontend.azurecontainerapps.io\"\n    },\n    duration: TimeSpan.FromMinutes(15));\n\n\u002F\u002F Report failure\nDeploymentReporter.ReportDeploymentFailure(\n    testName: \"DeployStarterToACA\",\n    resourceGroupName: \"aspire-e2e-...\",\n    errorMessage: \"Deployment timed out\",\n    logs: \"Full deployment logs...\");\n```\n\n### Asciinema Recordings\n\nTests generate recordings for debugging:\n\n```csharp\nvar recordingPath = DeploymentE2ETestHelpers.GetTestResultsRecordingPath(nameof(MyTest));\n\u002F\u002F CI: $GITHUB_WORKSPACE\u002Ftestresults\u002Frecordings\u002FMyTest.cast\n\u002F\u002F Local: \u002Ftmp\u002Faspire-deployment-e2e\u002Frecordings\u002FMyTest.cast\n```\n\n## Cleanup\n\nAlways cleanup Azure resources in a `finally` block:\n\n```csharp\nprivate static async Task CleanupResourceGroupAsync(string resourceGroupName)\n{\n    var process = new Process\n    {\n        StartInfo = new ProcessStartInfo\n        {\n            FileName = \"az\",\n            Arguments = $\"group delete --name {resourceGroupName} --yes --no-wait\",\n            RedirectStandardOutput = true,\n            RedirectStandardError = true,\n            UseShellExecute = false\n        }\n    };\n\n    process.Start();\n    await process.WaitForExitAsync();\n\n    if (process.ExitCode != 0)\n    {\n        var error = await process.StandardError.ReadToEndAsync();\n        throw new InvalidOperationException($\"Cleanup failed: {error}\");\n    }\n}\n```\n\n## Workflow Triggers\n\nDeployment tests are triggered by:\n\n1. **Nightly schedule** (03:00 UTC) - Runs on `main`\n2. **Manual dispatch** - Via GitHub Actions UI\n3. **Push to `deploy-test\u002F*`** - For rapid iteration\n\n### Iterating on Tests\n\nTo iterate quickly during development:\n\n```bash\n# Create a protected branch\ngit checkout -b deploy-test\u002Fmy-feature\n\n# Make changes\n# ...\n\n# Push to trigger workflow\ngit push origin deploy-test\u002Fmy-feature\n```\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION` | Yes | Azure subscription ID |\n| `ASPIRE_DEPLOYMENT_TEST_RG_PREFIX` | No | Resource group prefix (default: `aspire-e2e`) |\n| `AZURE_DEPLOYMENT_TEST_TENANT_ID` | CI | Azure AD tenant ID (GitHub secret) |\n| `AZURE_DEPLOYMENT_TEST_CLIENT_ID` | CI | OIDC app client ID (GitHub secret) |\n| `AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID` | CI | Azure subscription ID (GitHub secret) |\n\n## DO: Always Validate Prerequisites\n\n```csharp\nvar subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();\nif (string.IsNullOrEmpty(subscriptionId))\n{\n    Assert.Skip(\"Subscription not configured\");\n}\n\nif (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n{\n    Assert.Skip(\"Azure auth not available\");\n}\n```\n\n## DO: Generate Unique Resource Groups\n\n```csharp\nvar rgName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-test\");\n```\n\n## DO: Report to GitHub Summary\n\n```csharp\nDeploymentReporter.ReportDeploymentSuccess(...);\n\u002F\u002F or\nDeploymentReporter.ReportDeploymentFailure(...);\n```\n\n## DO: Always Cleanup Resources\n\n```csharp\ntry\n{\n    \u002F\u002F ... deployment test ...\n}\nfinally\n{\n    await CleanupResourceGroupAsync(resourceGroupName);\n}\n```\n\n## DON'T: Hardcode Subscription IDs\n\n```csharp\n\u002F\u002F DON'T\nvar subscriptionId = \"12345-abcde-...\";\n\n\u002F\u002F DO\nvar subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();\n```\n\n## DON'T: Skip Cleanup on Failure\n\n```csharp\n\u002F\u002F DON'T - cleanup might not run\nawait DeployAsync();\nawait CleanupAsync();  \u002F\u002F Skipped if deploy throws!\n\n\u002F\u002F DO - always cleanup\ntry\n{\n    await DeployAsync();\n}\nfinally\n{\n    await CleanupAsync();  \u002F\u002F Always runs\n}\n```\n\n## Troubleshooting\n\n### Authentication Failures\n\n**Local**: Ensure Azure CLI is authenticated:\n```bash\naz login\naz account show\n```\n\n**CI**: Check OIDC configuration:\n- `AZURE_CLIENT_ID` secret is set\n- `AZURE_TENANT_ID` secret is set\n- Workload Identity Federation is configured in Azure AD\n\n### Deployment Timeouts\n\nDeployments can take 15-30+ minutes. If tests timeout:\n- Check the asciinema recording for where it stopped\n- Increase timeout in `WaitUntil` calls\n- Check Azure portal for deployment status\n\n### Orphaned Resources\n\nFind and cleanup orphaned test resources:\n\n```bash\n# List all test resource groups\naz group list --query \"[?starts_with(name, 'aspire-e2e')]\" -o table\n\n# Delete specific resource group\naz group delete --name aspire-e2e-xxx --yes\n```\n\n### Tenant Rotation\n\nThe test tenant rotates every ~90 days. When rotation occurs:\n\n1. Create new App Registration in new tenant\n2. Configure Workload Identity Federation for the `deployment-testing` environment\n3. Grant Owner role on subscription (constrained - cannot create other Owner identities)\n4. Update GitHub secrets: `AZURE_DEPLOYMENT_TEST_CLIENT_ID`, `AZURE_DEPLOYMENT_TEST_TENANT_ID`, `AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID`\n","# Aspire Deployment End-to-End Testing\n\nThis skill provides patterns and practices for writing end-to-end tests that deploy Aspire applications to real Azure infrastructure.\n\n## Overview\n\nDeployment 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.\n\n**Location**: `tests\u002FAspire.Deployment.EndToEnd.Tests\u002F`\n\n**Supported Platforms**: Linux only (Hex1b requirement).\n\n**Prerequisites**:\n- Azure subscription with appropriate permissions\n- OIDC authentication (CI) or Azure CLI authentication (local)\n\n## Relationship to CLI E2E Tests\n\nDeployment tests build on the CLI E2E testing skill. Before working with deployment tests, familiarize yourself with:\n\n- [CLI E2E Testing Skill](..\u002Fcli-e2e-testing\u002FSKILL.md) - Core terminal automation patterns\n\nKey differences from CLI E2E tests:\n\n| Aspect | CLI E2E Tests | Deployment E2E Tests |\n|--------|---------------|----------------------|\n| Duration | 5-15 minutes | 15-45 minutes |\n| Resources | Local only | Azure resources |\n| Authentication | None | Azure OIDC\u002FCLI |\n| Cleanup | Temp directories | Azure resource groups |\n| Triggers | PR, push | Nightly, manual, deploy-test\u002F* |\n\n## Key Components\n\n### Core Classes\n\n- **`DeploymentE2ETestHelpers`** (`Helpers\u002FDeploymentE2ETestHelpers.cs`): Terminal factory and environment helpers\n- **`DeploymentE2EAutomatorHelpers`** (`Helpers\u002FDeploymentE2EAutomatorHelpers.cs`): Async extension methods on `Hex1bTerminalAutomator` for deployment scenarios\n- **`Hex1bAutomatorTestHelpers`** (shared): Common async extension methods on `Hex1bTerminalAutomator` (`WaitForSuccessPromptAsync`, `AspireNewAsync`, etc.)\n- **`AzureAuthenticationHelpers`** (`Helpers\u002FAzureAuthenticationHelpers.cs`): Azure auth and resource naming\n- **`DeploymentReporter`** (`Helpers\u002FDeploymentReporter.cs`): GitHub step summary reporting\n- **`SequenceCounter`** (`Helpers\u002FSequenceCounter.cs`): Prompt tracking (same as CLI E2E)\n\n### Test Architecture\n\nEach deployment test:\n\n1. Validates Azure authentication (skip if not available locally)\n2. Generates a unique resource group name\n3. Creates a project using `aspire new`\n4. Deploys using `aspire deploy`\n5. Verifies deployed endpoints work\n6. Reports results to GitHub step summary\n7. Cleans up Azure resources\n\n## Test Structure\n\n```csharp\npublic sealed class MyDeploymentTests(ITestOutputHelper output)\n{\n    [Fact]\n    public async Task DeployMyScenario()\n    {\n        \u002F\u002F 1. Validate prerequisites\n        var subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();\n        if (string.IsNullOrEmpty(subscriptionId))\n        {\n            Assert.Skip(\"Azure subscription not configured.\");\n        }\n\n        if (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n        {\n            if (DeploymentE2ETestHelpers.IsRunningInCI)\n            {\n                Assert.Fail(\"Azure auth not available in CI.\");\n            }\n            Assert.Skip(\"Azure auth not available. Run 'az login'.\");\n        }\n\n        \u002F\u002F 2. Setup\n        var resourceGroupName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-scenario\");\n        var workspace = TemporaryWorkspace.Create(output);\n        var startTime = DateTime.UtcNow;\n\n        try\n        {\n            \u002F\u002F 3. Build terminal and run deployment\n            using var terminal = DeploymentE2ETestHelpers.CreateTestTerminal();\n            var pendingRun = terminal.RunAsync(TestContext.Current.CancellationToken);\n\n            var counter = new SequenceCounter();\n            var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));\n\n            await auto.PrepareEnvironmentAsync(workspace, counter);\n            if (DeploymentE2ETestHelpers.IsRunningInCI)\n            {\n                await auto.SourceAspireCliEnvironmentAsync(counter);\n            }\n            await auto.AspireNewAsync(\"MyProject\", counter, useRedisCache: false);\n            \u002F\u002F ... deployment steps ...\n\n            await auto.TypeAsync(\"exit\");\n            await auto.EnterAsync();\n            await pendingRun;\n\n            \u002F\u002F 4. Report success\n            var duration = DateTime.UtcNow - startTime;\n            DeploymentReporter.ReportDeploymentSuccess(\n                nameof(DeployMyScenario),\n                resourceGroupName,\n                deploymentUrls,\n                duration);\n        }\n        catch (Exception ex)\n        {\n            DeploymentReporter.ReportDeploymentFailure(\n                nameof(DeployMyScenario),\n                resourceGroupName,\n                ex.Message);\n            throw;\n        }\n        finally\n        {\n            \u002F\u002F 5. Cleanup Azure resources\n            await CleanupResourceGroupAsync(resourceGroupName);\n        }\n    }\n}\n```\n\n## Extension Methods\n\n### DeploymentE2EAutomatorHelpers Extensions on Hex1bTerminalAutomator\n\n| Method | Description |\n|--------|-------------|\n| `PrepareEnvironmentAsync(workspace, counter)` | Sets up the terminal environment with custom prompt and workspace directory |\n| `InstallAspireCliFromPullRequestAsync(prNumber, counter)` | Downloads and installs the Aspire CLI from a PR build artifact |\n| `InstallAspireCliReleaseAsync(counter)` | Installs the latest released Aspire CLI |\n| `SourceAspireCliEnvironmentAsync(counter)` | Adds `~\u002F.aspire\u002Fbin` to PATH so the `aspire` command is available |\n\nThese extend `Hex1bTerminalAutomator` and are used alongside the shared `Hex1bAutomatorTestHelpers` methods (`WaitForSuccessPromptAsync`, `AspireNewAsync`, etc.) documented in the [CLI E2E Testing Skill](..\u002Fcli-e2e-testing\u002FSKILL.md).\n\n## Azure Authentication\n\n### In CI (GitHub Actions)\n\nTests use OIDC (Workload Identity Federation) for authentication:\n\n```yaml\n- name: Azure Login (OIDC)\n  uses: azure\u002Flogin@v2\n  with:\n    client-id: ${{ secrets.AZURE_CLIENT_ID }}\n    tenant-id: ${{ secrets.AZURE_TENANT_ID }}\n    subscription-id: ${{ vars.ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION }}\n```\n\nThe test code automatically detects CI and uses `DefaultAzureCredential` which picks up the OIDC session.\n\n### Local Development\n\nAuthenticate with Azure CLI before running tests:\n\n```bash\n# Login to Azure\naz login\n\n# Set your subscription\naz account set --subscription \"your-subscription-id\"\n\n# Set environment variable\nexport ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION=\"your-subscription-id\"\n\n# Run tests\ndotnet test tests\u002FAspire.Deployment.EndToEnd.Tests\u002F\n```\n\n### Authentication Helpers\n\n```csharp\n\u002F\u002F Check if auth is available\nif (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n{\n    Assert.Skip(\"Azure auth not available\");\n}\n\n\u002F\u002F Get subscription ID\nvar subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();\n\n\u002F\u002F Generate unique resource group name\nvar rgName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-test\");\n\u002F\u002F Result: \"aspire-e2e-my-test-20240115-abc12345\"\n\n\u002F\u002F Check auth type\nif (AzureAuthenticationHelpers.IsOidcConfigured())\n{\n    \u002F\u002F Using OIDC (CI)\n}\nelse\n{\n    \u002F\u002F Using Azure CLI (local)\n}\n```\n\n## Resource Group Naming\n\nResource groups are named with a consistent pattern for easy identification and cleanup:\n\n```\n{prefix}-{testname}-{date}-{runid}\n```\n\nExample: `aspire-e2e-aca-starter-20240115-12345678`\n\nComponents:\n- **prefix**: From `ASPIRE_DEPLOYMENT_TEST_RG_PREFIX` (default: `aspire-e2e`)\n- **testname**: Sanitized test name (lowercase, alphanumeric, hyphens)\n- **date**: UTC date in YYYYMMDD format\n- **runid**: GitHub run ID or random GUID suffix\n\n## Reporting Results\n\n### GitHub Step Summary\n\nTests automatically write to the GitHub step summary:\n\n```csharp\n\u002F\u002F Report success with URLs\nDeploymentReporter.ReportDeploymentSuccess(\n    testName: \"DeployStarterToACA\",\n    resourceGroupName: \"aspire-e2e-...\",\n    deploymentUrls: new Dictionary\u003Cstring, string>\n    {\n        [\"Dashboard\"] = \"https:\u002F\u002Fdashboard.azurecontainerapps.io\",\n        [\"Web Frontend\"] = \"https:\u002F\u002Fwebfrontend.azurecontainerapps.io\"\n    },\n    duration: TimeSpan.FromMinutes(15));\n\n\u002F\u002F Report failure\nDeploymentReporter.ReportDeploymentFailure(\n    testName: \"DeployStarterToACA\",\n    resourceGroupName: \"aspire-e2e-...\",\n    errorMessage: \"Deployment timed out\",\n    logs: \"Full deployment logs...\");\n```\n\n### Asciinema Recordings\n\nTests generate recordings for debugging:\n\n```csharp\nvar recordingPath = DeploymentE2ETestHelpers.GetTestResultsRecordingPath(nameof(MyTest));\n\u002F\u002F CI: $GITHUB_WORKSPACE\u002Ftestresults\u002Frecordings\u002FMyTest.cast\n\u002F\u002F Local: \u002Ftmp\u002Faspire-deployment-e2e\u002Frecordings\u002FMyTest.cast\n```\n\n## Cleanup\n\nAlways cleanup Azure resources in a `finally` block:\n\n```csharp\nprivate static async Task CleanupResourceGroupAsync(string resourceGroupName)\n{\n    var process = new Process\n    {\n        StartInfo = new ProcessStartInfo\n        {\n            FileName = \"az\",\n            Arguments = $\"group delete --name {resourceGroupName} --yes --no-wait\",\n            RedirectStandardOutput = true,\n            RedirectStandardError = true,\n            UseShellExecute = false\n        }\n    };\n\n    process.Start();\n    await process.WaitForExitAsync();\n\n    if (process.ExitCode != 0)\n    {\n        var error = await process.StandardError.ReadToEndAsync();\n        throw new InvalidOperationException($\"Cleanup failed: {error}\");\n    }\n}\n```\n\n## Workflow Triggers\n\nDeployment tests are triggered by:\n\n1. **Nightly schedule** (03:00 UTC) - Runs on `main`\n2. **Manual dispatch** - Via GitHub Actions UI\n3. **Push to `deploy-test\u002F*`** - For rapid iteration\n\n### Iterating on Tests\n\nTo iterate quickly during development:\n\n```bash\n# Create a protected branch\ngit checkout -b deploy-test\u002Fmy-feature\n\n# Make changes\n# ...\n\n# Push to trigger workflow\ngit push origin deploy-test\u002Fmy-feature\n```\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ASPIRE_DEPLOYMENT_TEST_SUBSCRIPTION` | Yes | Azure subscription ID |\n| `ASPIRE_DEPLOYMENT_TEST_RG_PREFIX` | No | Resource group prefix (default: `aspire-e2e`) |\n| `AZURE_DEPLOYMENT_TEST_TENANT_ID` | CI | Azure AD tenant ID (GitHub secret) |\n| `AZURE_DEPLOYMENT_TEST_CLIENT_ID` | CI | OIDC app client ID (GitHub secret) |\n| `AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID` | CI | Azure subscription ID (GitHub secret) |\n\n## DO: Always Validate Prerequisites\n\n```csharp\nvar subscriptionId = AzureAuthenticationHelpers.TryGetSubscriptionId();\nif (string.IsNullOrEmpty(subscriptionId))\n{\n    Assert.Skip(\"Subscription not configured\");\n}\n\nif (!AzureAuthenticationHelpers.IsAzureAuthAvailable())\n{\n    Assert.Skip(\"Azure auth not available\");\n}\n```\n\n## DO: Generate Unique Resource Groups\n\n```csharp\nvar rgName = AzureAuthenticationHelpers.GenerateResourceGroupName(\"my-test\");\n```\n\n## DO: Report to GitHub Summary\n\n```csharp\nDeploymentReporter.ReportDeploymentSuccess(...);\n\u002F\u002F or\nDeploymentReporter.ReportDeploymentFailure(...);\n```\n\n## DO: Always Cleanup Resources\n\n```csharp\ntry\n{\n    \u002F\u002F ... deployment test ...\n}\nfinally\n{\n    await CleanupResourceGroupAsync(resourceGroupName);\n}\n```\n\n## DON'T: Hardcode Subscription IDs\n\n```csharp\n\u002F\u002F DON'T\nvar subscriptionId = \"12345-abcde-...\";\n\n\u002F\u002F DO\nvar subscriptionId = AzureAuthenticationHelpers.GetSubscriptionId();\n```\n\n## DON'T: Skip Cleanup on Failure\n\n```csharp\n\u002F\u002F DON'T - cleanup might not run\nawait DeployAsync();\nawait CleanupAsync();  \u002F\u002F Skipped if deploy throws!\n\n\u002F\u002F DO - always cleanup\ntry\n{\n    await DeployAsync();\n}\nfinally\n{\n    await CleanupAsync();  \u002F\u002F Always runs\n}\n```\n\n## Troubleshooting\n\n### Authentication Failures\n\n**Local**: Ensure Azure CLI is authenticated:\n```bash\naz login\naz account show\n```\n\n**CI**: Check OIDC configuration:\n- `AZURE_CLIENT_ID` secret is set\n- `AZURE_TENANT_ID` secret is set\n- Workload Identity Federation is configured in Azure AD\n\n### Deployment Timeouts\n\nDeployments can take 15-30+ minutes. If tests timeout:\n- Check the asciinema recording for where it stopped\n- Increase timeout in `WaitUntil` calls\n- Check Azure portal for deployment status\n\n### Orphaned Resources\n\nFind and cleanup orphaned test resources:\n\n```bash\n# List all test resource groups\naz group list --query \"[?starts_with(name, 'aspire-e2e')]\" -o table\n\n# Delete specific resource group\naz group delete --name aspire-e2e-xxx --yes\n```\n\n### Tenant Rotation\n\nThe test tenant rotates every ~90 days. When rotation occurs:\n\n1. Create new App Registration in new tenant\n2. Configure Workload Identity Federation for the `deployment-testing` environment\n3. Grant Owner role on subscription (constrained - cannot create other Owner identities)\n4. Update GitHub secrets: `AZURE_DEPLOYMENT_TEST_CLIENT_ID`, `AZURE_DEPLOYMENT_TEST_TENANT_ID`, `AZURE_DEPLOYMENT_TEST_SUBSCRIPTION_ID`\n",{"name":5,"description":7},"main","cec61ac9b795bbfd9913f0c7196689b0d7a215d7",".agents\u002Fskills\u002Fdeployment-e2e-testing",1039,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire","https:\u002F\u002Faspire.dev","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:32:23",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add microsoft\u002Faspire --skill deployment-e2e-testing",{"tool":60,"command":61},"bunx","bunx skills add microsoft\u002Faspire --skill deployment-e2e-testing",{"tool":63,"command":64},"pnpm","pnpm dlx skills add microsoft\u002Faspire --skill deployment-e2e-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdeployment-e2e-testing\u002FSKILL.md",true,[],[69,91,112,123,141,167],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":39},"01M6FKZQPMA7VRA0PRBZRDFJTX","vscode-extension","Use when investigating, developing, debugging, testing, or reviewing Aspire VS Code extension behavior under extension\u002F, including extension UI, command, debugger, RPC, DCP, MCP, and CLI-integration issues or features.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvscode-extension\u002FSKILL.md",[],[76,77,78,22,79,80,35,81,82,83,84,85,86,87,88,89,30,90,25],"vscode","vscode extension","extension","MCP","cli","debugging","code","issues","rpc","ui","integration","debugger","command","behavior","features",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":39},"01M6FKZJG81XP80SVWFBJVMDWN","update-container-images","Updates Docker container image tags used by Aspire hosting integrations. Queries registries for newer tags, uses LLM to determine version-compatible updates, and applies changes. Use this when asked to update container image versions.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fupdate-container-images\u002FSKILL.md",[],[98,99,100,101,102,103,104,35,105,30,106,107,108,109,110,26,111,25],"container images","update","container","images","update container images","image","docker","integrations","version","hosting","queries","tags","updates","changes",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":39},"01M6FKZDY1MY0QA62EYSDG5NHW","test-management","Quarantines or disables flaky\u002Fproblematic tests using the QuarantineTools utility","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-management\u002FSKILL.md",[],[119,120,121,29,122],"test","management","test management","utility",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":39},"01M6FKZAQ428JX8F6NSA19XBQJ","startup-perf","Measures Aspire startup profiling with CLI self-profile capture and dashboard export traces.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstartup-perf\u002FSKILL.md",[],[130,131,132,80,133,35,134,135,136,137,138,139,140],"perf","startup","startup perf","dashboard","profiling","capture","profile","export","self","with","traces",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":39},"01M6FKZ4W4J0ET0Q0C2Z30HYRV","reviewing-aspire-architecture","Use only when the user explicitly requests a deep Aspire architectural or pattern review of an existing PR or diff, or when a generic reviewer escalates a named Aspire-domain question it cannot resolve. Do not use for ordinary review, implementation, debugging, explanation, or design discussion—even when a PR is referenced—and never select it from changed file paths alone.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Freviewing-aspire-architecture\u002FSKILL.md",[],[148,35,149,150,151,152,81,153,154,155,156,30,157,158,159,160,161,162,163,164,26,165,166,25],"architecture","reviewing aspire architecture","design","review","pr","file","select","reviewer","question","diff","never","only","do","domain","pattern","deep","paths","Existing","generic",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":39},"01M6FKYZ44BEPJNV8VQ0X73CZR","pr-testing","Use when asked to test a microsoft\u002Faspire pull request, including CLI, hosting, dashboard, component, template, and VS Code extension changes. Also covers testing PRs that change CI infrastructure — GitHub Actions (workflows, actions, gh-aw agentic workflows, CI scripts under .github\u002F and eng\u002F) and Azure DevOps pipelines (eng\u002Fpipelines, eng\u002Fcommon).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpr-testing\u002FSKILL.md",[],[22,152,174,80,175,176,133,177,178,179,180,181,35,182,82,183,184,185,186,187,30,188,107,189,78,190,111,191],"pr testing","github","agentic","workflows","change","component","agentic workflows","azure devops","infrastructure","actions","ci","github actions","template","common","devops","pipelines","scripts","prs"]