Skip to content

Require Azure resource groups in Radius.Core environments - #12495

Draft
willtsai with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-resource-group-name-requirement
Draft

Require Azure resource groups in Radius.Core environments#12495
willtsai with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-resource-group-name-requirement

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Azure environments accepted provider configuration without resourceGroupName, producing invalid subscription-scoped recipe contexts.

  • Require providers.azure.resourceGroupName across TypeSpec, OpenAPI, Go, and Bicep contracts.
  • Reject legacy or partially populated configurations with a property-specific error.
  • Preserve valid Azure scope construction:
/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>

Reason for change

Azure Bicep and Terraform recipes require a resource group. Schema-valid environments could previously omit it and fail later during recipe deployment.

How to test

Create an Azure environment without resourceGroupName and verify schema validation rejects it. Verify the config loader also returns:

providers.azure.resourceGroupName is required when the Azure provider is configured

File change summary

File Summary of change
typespec/Radius.Core/environments.tsp Makes resourceGroupName required.
swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json Regenerates the required-property contract.
hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json Marks the Bicep property as required.
pkg/corerp/api/v20250801preview/zz_generated_models.go Regenerates the Go API model.
pkg/corerp/datamodel/environment_v20250801preview.go Aligns the internal JSON contract.
pkg/recipes/configloader/environment.go Fails fast when the resource group is absent.
pkg/recipes/configloader/environment_test.go Covers missing and valid resource-group configurations.

Copilot AI and others added 2 commits July 20, 2026 18:11
Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix resourceGroupName requirement for Azure recipes Require Azure resource groups in Radius.Core environments Jul 20, 2026
Copilot AI requested a review from willtsai July 20, 2026 18:19
Copilot AI review requested due to automatic review settings July 21, 2026 18:21
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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 tightens the Azure provider contract for Radius.Core/environments (2025-08-01-preview) so environments can no longer be configured without providers.azure.resourceGroupName, preventing invalid subscription-scoped recipe contexts and failing earlier with a property-specific error.

Changes:

  • Make providers.azure.resourceGroupName required in TypeSpec and regenerate OpenAPI/Go/Bicep type artifacts.
  • Update internal datamodel JSON contract to treat resourceGroupName as required (no omitempty).
  • Add fast-fail validation in the recipe config loader plus a unit test case for missing resource group.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
typespec/Radius.Core/environments.tsp Makes Azure resourceGroupName required in the source contract.
swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json Regenerated OpenAPI to require resourceGroupName and update its description.
hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json Regenerated Bicep types so resourceGroupName is required.
pkg/corerp/api/v20250801preview/zz_generated_models.go Regenerated Go API model marking ResourceGroupName as required.
pkg/corerp/datamodel/environment_v20250801preview.go Aligns internal datamodel JSON tags to require resourceGroupName.
pkg/recipes/configloader/environment.go Fails fast when Azure provider is configured without a resource group.
pkg/recipes/configloader/environment_test.go Updates tests to expect the new error when RG is missing; keeps coverage for valid RG.
Files not reviewed (1)
  • pkg/corerp/api/v20250801preview/zz_generated_models.go: Generated file

Comment on lines +167 to +171
if envDatamodel.Properties.Providers.Azure.ResourceGroupName == "" {
return nil, fmt.Errorf("providers.azure.resourceGroupName is required when the Azure provider is configured")
}
scope := "/subscriptions/" + envDatamodel.Properties.Providers.Azure.SubscriptionId +
"/resourceGroups/" + envDatamodel.Properties.Providers.Azure.ResourceGroupName
Comment on lines +83 to +84
@doc("Azure resource group hosting deployed resources.")
resourceGroupName: string;
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Unit Tests

    2 files  ±0    457 suites  ±0   7m 32s ⏱️ +6s
6 063 tests ±0  6 061 ✅ ±0  2 💤 ±0  0 ❌ ±0 
7 270 runs  ±0  7 268 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 22242d2. ± Comparison against base commit d5258ce.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
github.com/radius-project/radius/pkg/recipes/configloader ‑ TestGetConfigurationV20250801/azure_provider_with_subscription_only_v20250801
github.com/radius-project/radius/pkg/recipes/configloader ‑ TestGetConfigurationV20250801/azure_provider_without_resource_group_v20250801

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.86%. Comparing base (d5258ce) to head (22242d2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12495      +/-   ##
==========================================
- Coverage   53.87%   53.86%   -0.02%     
==========================================
  Files         765      765              
  Lines       50647    50648       +1     
==========================================
- Hits        27288    27283       -5     
- Misses      20788    20791       +3     
- Partials     2571     2574       +3     

☔ 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.

Copilot AI review requested due to automatic review settings July 21, 2026 23:25
@radius-functional-tests

radius-functional-tests Bot commented Jul 21, 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 radius-project/radius
Commit ref 22242d2
Unique ID funce9b97c3640
Image tag pr-funce9b97c3640
  • 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-funce9b97c3640
  • 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-funce9b97c3640
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funce9b97c3640
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funce9b97c3640
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funce9b97c3640
  • 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

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pkg/corerp/api/v20250801preview/zz_generated_models.go: Generated file

Comment on lines 166 to +171
if envDatamodel.Properties.Providers.Azure != nil {
scope := "/subscriptions/" + envDatamodel.Properties.Providers.Azure.SubscriptionId
if envDatamodel.Properties.Providers.Azure.ResourceGroupName != "" {
scope += "/resourceGroups/" + envDatamodel.Properties.Providers.Azure.ResourceGroupName
if envDatamodel.Properties.Providers.Azure.ResourceGroupName == "" {
return nil, fmt.Errorf("providers.azure.resourceGroupName is required when the Azure provider is configured")
}
scope := "/subscriptions/" + envDatamodel.Properties.Providers.Azure.SubscriptionId +
"/resourceGroups/" + envDatamodel.Properties.Providers.Azure.ResourceGroupName
@github-actions

Copy link
Copy Markdown

Functional Tests - corerp-cloud

30 tests  ±0   27 ✅  - 2   55m 49s ⏱️ + 34m 51s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    2 ❌ +2 

For more details on these failures, see this check.

Results for commit 22242d2. ± Comparison against base commit d5258ce.

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.

Radius.Core/environments providers.azure.resourceGroupName is schema-optional but effectively required for Azure recipes

3 participants