Show Azure Portal links in deployment summaries#16173
Show Azure Portal links in deployment summaries#16173spboyer wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Add portal links for individual deployed resources (Container Apps, App Service) to the pipeline summary output after deployment completes. Changes: - Add GetResourceUrl method to AzurePortalUrls for generating portal links from ARM resource IDs (supports child resources like deployment slots) - Update AzureContainerAppResource print-summary step to include portal link for both external-endpoint and no-endpoint cases - Update AzureAppServiceWebSiteResource print-summary step to include portal link, with support for deployment slot URLs - Both read subscription/RG/tenant from IDeploymentStateManager (populated during provisioning) — no internal member access needed - Add InternalsVisibleTo for Aspire.Hosting.Azure.AppContainers to access AzurePortalUrls helper - Add unit tests for all AzurePortalUrls methods Fixes microsoft#16119 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Live Deployment VerificationDeployed a minimal Container Apps AppHost to Azure ( The Full pipeline output: All 12/12 steps succeeded (4m 56s)Resources cleaned up ( |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Azure Portal links for deployed Azure resources to the pipeline deployment summary, enabling quick navigation from CI/CD output to the Azure Portal.
Changes:
- Introduced
AzurePortalUrls.GetResourceUrl(resourceId, tenantId?)for generating portal links from full ARM resource IDs. - Updated Azure App Service and Azure Container Apps summary steps to include portal links regardless of public endpoint presence.
- Added unit tests for portal URL generation and expanded
InternalsVisibleToto allow cross-assembly access.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.Azure.Tests/AzurePortalUrlsTests.cs | Adds tests for resource group, resource, and deployment portal URL generation. |
| src/Aspire.Hosting.Azure/AzurePortalUrls.cs | Adds a base portal URL constant and a new helper to build portal URLs from ARM resource IDs. |
| src/Aspire.Hosting.Azure/Aspire.Hosting.Azure.csproj | Grants AppContainers assembly access to internal portal URL helpers. |
| src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebSiteResource.cs | Adds portal link entries to App Service deployment summary; includes slot support. |
| src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppResource.cs | Adds portal link entries to Container Apps deployment summary. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 5
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16173Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16173" |
- Compose PortalDeploymentOverviewUrl from PortalBaseUrl constant - Use GetService instead of GetRequiredService for graceful degradation when IDeploymentStateManager is not registered - Remove ToLowerInvariant() from ACA resource name in ARM resource ID - Pass base site name (not hostname) to GetPortalUrlAsync for App Service - Strengthen test assertions from Contains to full equality Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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.
|
|
Closing — this is superseded by #16142 (merged by @davidfowl), which implements the same feature with a cleaner approach: shared source for |
Description
Adds Azure Portal links for individual deployed resources to the pipeline summary output after
aspire deploycompletes.Before
After
Changes
AzurePortalUrls.cs— AddedGetResourceUrl(resourceId, tenantId?)method that generates portal URLs from full ARM resource IDs (supports child resources like deployment slots)AzureContainerAppResource.cs— Updated print-summary step to include portal link for both external-endpoint and no-endpoint casesAzureAppServiceWebSiteResource.cs— Updated print-summary step to include portal link with deployment slot URL supportAspire.Hosting.Azure.csproj— AddedInternalsVisibleToforAspire.Hosting.Azure.AppContainersto accessAzurePortalUrlshelperAzurePortalUrlsTests.cs— 8 unit tests covering all URL generation methodsImplementation Notes
IDeploymentStateManager(the "Azure" section populated during provisioning) — no internal member access needed from AppContainers/AppService assemblies/subscriptions/.../providers/Microsoft.App/containerApps/...) which handles nested resources like App Service slots naturallyTesting
AzurePortalUrls(all methods, with/without tenant, slots)Fixes #16119