populate azure portal links for az resources in graph#12295
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a portalUrl field to application graph output resources and populates it for Azure-backed outputs so rad app graph can render clickable Azure Portal deep links (for both Applications.Core and Radius.Core graphs). It also adds an Azure MySQL functional test and supporting Terraform test recipes.
Changes:
- Add optional
portalUrltoApplicationGraphOutputResourcein TypeSpec + generated Swagger/Go models. - Populate
portalUrlserver-side for non-UCP-qualified (ARM) output resource IDs using the registered Azure tenant ID. - Update CLI graph rendering to use
portalUrldirectly for terminal hyperlinks, and add a cloud functional test + Terraform recipes to validate behavior.
Contributor-doc impact (advisory):
docs/architecture/application-graph.mdappears stale: it documentsApplicationGraphOutputResourceas{id,type,name}only and describes Azure portal hyperlinking as CLI-derived. It likely needs to mention the newportalUrlfield and that hyperlinks are now driven by the API response.
Reviewed changes
Copilot reviewed 21 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| typespec/Radius.Core/applications.tsp | Adds portalUrl?: string to graph output resources for Radius.Core. |
| typespec/Applications.Core/applications.tsp | Adds portalUrl?: string to graph output resources for Applications.Core. |
| swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json | Updates OpenAPI schema to include portalUrl. |
| swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json | Updates OpenAPI schema to include portalUrl. |
| pkg/corerp/frontend/controller/applications/graph_util.go | Builds portal links for Azure ARM output resources and threads tenant ID through graph computation. |
| pkg/corerp/frontend/controller/applications/getgraph.go | Fetches Azure tenant ID (best-effort) and passes it into graph computation. |
| pkg/corerp/frontend/controller/applications/graph_util_test.go | Updates unit test callsite for new computeGraph signature. |
| pkg/corerp/api/v20250801preview/zz_generated_models.go | Adds PortalURL *string to generated model. |
| pkg/corerp/api/v20250801preview/zz_generated_models_serde.go | Adds JSON serde support for portalUrl. |
| pkg/corerp/api/v20231001preview/zz_generated_models.go | Adds PortalURL *string to generated model. |
| pkg/corerp/api/v20231001preview/zz_generated_models_serde.go | Adds JSON serde support for portalUrl. |
| pkg/cli/cmd/app/graph/preview/graph.go | Uses portalUrl for hyperlinks in preview graph output. |
| pkg/cli/cmd/app/graph/display.go | Switches hyperlink building to use the API-provided portalUrl. |
| pkg/cli/cmd/app/graph/display_test.go | Updates CLI display test to supply/expect PortalURL. |
| test/validation/shared.go | Adds a Radius.Data resource-type constant used by RP validation. |
| test/testrecipes/test-terraform-recipes/secrets-kubernetes/variables.tf | Adds Terraform recipe input variables (context) for secrets-kubernetes test module. |
| test/testrecipes/test-terraform-recipes/secrets-kubernetes/main.tf | Adds Terraform recipe to provision a Kubernetes Secret from Radius.Security/secrets. |
| test/testrecipes/test-terraform-recipes/mysql-azure/variables.tf | Adds Terraform recipe input variables for mysql-azure test module. |
| test/testrecipes/test-terraform-recipes/mysql-azure/main.tf | Adds Terraform recipe to provision Azure MySQL Flexible Server + database and emit outputs/secrets. |
| test/functional-portable/corerp/cloud/resources/testdata/corerp-radiuscore-azure-mysql-portallink.bicep | New Bicep scenario deploying Radius.Core env/app + mysql to exercise portalUrl in graph. |
| test/functional-portable/corerp/cloud/resources/radiuscore_azure_mysql_portallink_test.go | New cloud functional test asserting portalUrl is present and well-formed. |
| pkg/components/database/postgres/postgresclient.go | Updates SQL formatting and ensures etag is updated on conflict/update paths. |
| build/scripts/start-radius.sh | Sets TERRAFORM_TEST_GLOBAL_DIR to a writable location for macOS compatibility. |
| .github/workflows/functional-test-noncloud.yaml | Temporarily comments out most noncloud functional matrix legs. |
| .github/workflows/functional-test-cloud.yaml | Temporarily filters cloud matrix + restricts test execution to a single test. |
Files not reviewed (4)
- pkg/corerp/api/v20231001preview/zz_generated_models.go: Generated file
- pkg/corerp/api/v20231001preview/zz_generated_models_serde.go: Generated file
- pkg/corerp/api/v20250801preview/zz_generated_models.go: Generated file
- pkg/corerp/api/v20250801preview/zz_generated_models_serde.go: Generated file
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12295 +/- ##
==========================================
- Coverage 52.96% 52.93% -0.03%
==========================================
Files 754 754
Lines 48686 48708 +22
==========================================
- Hits 25785 25784 -1
- Misses 20472 20493 +21
- Partials 2429 2431 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e2fdd98 to
ceba9be
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
Description
Populate an Azure Portal deep link (
portalUrl) on Azure output resources surfaced by the Application graph, so users can click through fromrad app graphoutput into the Azure Portal. They can also get the data through -o json flag.Type of change
Fixes: #11943
Contributor checklist
Please verify that the PR meets the following requirements, where applicable:
eng/design-notes/in this repository, if new APIs are being introduced.