Skip to content

populate azure portal links for az resources in graph#12295

Open
nithyatsu wants to merge 14 commits into
radius-project:mainfrom
nithyatsu:azlinks_pr
Open

populate azure portal links for az resources in graph#12295
nithyatsu wants to merge 14 commits into
radius-project:mainfrom
nithyatsu:azlinks_pr

Conversation

@nithyatsu

@nithyatsu nithyatsu commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Populate an Azure Portal deep link (portalUrl) on Azure output resources surfaced by the Application graph, so users can click through from rad app graph output into the Azure Portal. They can also get the data through -o json flag.

image image
nithya@Nithyas-MacBook-Pro radius % drad app graph -a myhotapp  --preview -o json
{
  "resources": [
    {
      "connections": [],
      "id": "/planes/radius/local/resourcegroups/default/providers/Radius.Data/mySqlDatabases/mysql222",
      "name": "mysql222",
      "outputResources": [
        {
          "id": "/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76",
          "name": "mysql-1c4f944df54a76",
          "portalUrl": "https://portal.azure.com/#@a5c62bbf-93b1-47db-b882-cd073086c36c/resource/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76",
          "type": "Microsoft.DBforMySQL/flexibleServers"
        },
        {
          "id": "/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76/databases/mysql_db",
          "name": "mysql_db",
          "portalUrl": "https://portal.azure.com/#@a5c62bbf-93b1-47db-b882-cd073086c36c/resource/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76/databases/mysql_db",
          "type": "Microsoft.DBforMySQL/flexibleServers/databases"
        },
        {
          "id": "/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76/firewallRules/AllowAzureServices",
          "name": "AllowAzureServices",
          "portalUrl": "https://portal.azure.com/#@a5c62bbf-93b1-47db-b882-cd073086c36c/resource/subscriptions/83d22c15-134b-4a0a-b10d-0a63710f9ab3/resourceGroups/nit-gh/providers/Microsoft.DBforMySQL/flexibleServers/mysql-1c4f944df54a76/firewallRules/AllowAzureServices",
          "type": "Microsoft.DBforMySQL/flexibleServers/firewallRules"
        }
      ],
      "properties": {
        "application": "/planes/radius/local/resourcegroups/default/providers/Radius.Core/applications/myhotapp",
        "database": "mysql_db",
        "environment": "/planes/radius/local/resourcegroups/default/providers/Radius.Core/environments/default",
        "host": "mysql-1c4f944df54a76.mysql.database.azure.com",
        "port": 3306,
        "recipe": {
          "name": "default",
          "recipeStatus": "success"
        },
        "secretName": "despicablesecret"
      },
      "provisioningState": "Succeeded",
      "type": "Radius.Data/mySqlDatabases"
    }
  ]
}

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Fixes: #11943

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

Copilot AI review requested due to automatic review settings July 1, 2026 17:45
@nithyatsu nithyatsu requested review from a team as code owners July 1, 2026 17:45
@nithyatsu nithyatsu marked this pull request as draft July 1, 2026 17:46
@nithyatsu nithyatsu changed the title populate azure portal links for az resources in graph wip populate azure portal links for az resources in graph Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 portalUrl to ApplicationGraphOutputResource in TypeSpec + generated Swagger/Go models.
  • Populate portalUrl server-side for non-UCP-qualified (ARM) output resource IDs using the registered Azure tenant ID.
  • Update CLI graph rendering to use portalUrl directly for terminal hyperlinks, and add a cloud functional test + Terraform recipes to validate behavior.

Contributor-doc impact (advisory):

  • docs/architecture/application-graph.md appears stale: it documents ApplicationGraphOutputResource as {id,type,name} only and describes Azure portal hyperlinking as CLI-derived. It likely needs to mention the new portalUrl field 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

Comment thread test/validation/shared.go Outdated
Comment thread .github/workflows/functional-test-noncloud.yaml Outdated
Comment thread .github/workflows/functional-test-cloud.yaml Outdated
Comment thread .github/workflows/functional-test-cloud.yaml Outdated
Comment thread test/testrecipes/test-terraform-recipes/mysql-azure/variables.tf
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.88889% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.93%. Comparing base (659a78c) to head (aaa1705).

Files with missing lines Patch % Lines
...erp/frontend/controller/applications/graph_util.go 27.58% 20 Missing and 1 partial ⚠️
pkg/cli/cmd/app/graph/preview/graph.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Functional Tests - corerp-cloud

30 tests  +4   29 ✅ +4   20m 23s ⏱️ + 8m 56s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit aaa1705. ± Comparison against base commit 659a78c.

♻️ This comment has been updated with latest results.

@nithyatsu nithyatsu changed the title wip populate azure portal links for az resources in graph populate azure portal links for az resources in graph Jul 2, 2026
@nithyatsu nithyatsu marked this pull request as ready for review July 2, 2026 18:51
@radius-functional-tests

radius-functional-tests Bot commented Jul 2, 2026

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository nithyatsu/radius
Commit ref aaa1705
Unique ID func031b494287
Image tag pr-func031b494287
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func031b494287
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func031b494287
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func031b494287
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func031b494287
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func031b494287
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
⌛ Starting corerp-cloud functional tests...
✅ corerp-cloud functional tests succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement deep links to Azure Portal on resource graph nodes

2 participants