You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clarify rad deploy environment selection when switching scopes #10307
rad group create my-group
rad group switch my-group
rad env create my-env
rad env switch my-env
After creating the group and environment, we make the choice to use them as current context using the expilicit rad <env|group> switch. This can be sometime confusing.
For instance, consider the below sequence:
rad group create my-group
rad group switch my-group
At this point, we are in scope my-group. This means
rad env create, the environment resource would be created in the scope /resourceGroups/my-group.
rad deploy uses the environment my-group in the same scope /resourceGroups/my-group/providers/applications.core/environment/my-env
rad env create my-env
rad env switch my-env
rad deploy app.bicep
Continue with subequent commands listed below:
rad group create another-group
rad group switch another-group
rad env create my-env
# do not do a rad env switch
rad deploy app.bicep
In the above sequence of commands, rad group switch is effective and my-environment is created as a child resource in this scope ( /resourceGroups/another-group/providers/applications.core/environment/my-env).
However, rad deploy app.bicep will still use the environment in the old scope (with same name) since we missed the rad env switch. rad deploy output only specifies the name of the environment and not full ID, so it is easy to be misinterpreted.
This can be a confusing user experience and needs a fix.
Note: An application should be able to use environment in scopes different from the scope where it is deployed. We have a -e flag for rad deploy which is used to deploy the application using an environment in different scope.
👋 @nithyatsu Thanks for filing this feature request.
A project maintainer will review this feature request and get back to you soon.
We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.
For more information on our triage process please visit our triage overview
changed the title [-]rad deploy should be more explicit about the environment in use. [/-][+]rad deploy should be more explicit about the environment in use[/+]on Sep 2, 2025
changed the title [-]rad deploy should be more explicit about the environment in use[/-][+]Improve context Switching Behavior in rad cli to prevent confusing environment usage[/+]on Sep 2, 2025
changed the title [-]Improve context Switching Behavior in rad cli to prevent confusing environment usage[/-][+]Improve context switching behavior in rad cli to prevent confusing environment usage for rad deploy[/+]on Sep 2, 2025
changed the title [-]Improve context switching behavior in rad cli to prevent confusing environment usage for rad deploy[/-][+]Improve scope switching behavior in rad cli to prevent confusing environment usage for rad deploy[/+]on Sep 2, 2025
changed the title [-]Improve scope switching behavior in rad cli to prevent confusing environment usage for rad deploy[/-][+]Clarify rad deploy environment selection when switching scopes[/+]on Sep 2, 2025
changed the title [-]Clarify rad deploy environment selection when switching scopes[/-][+]clarify rad deploy environment selection when switching scopes[/+]on Sep 2, 2025
To help us investigate further, we need additional information to reproduce or understand this issue. Please ensure you have steps to reproduce and information about your OS, rad CLI version, and runtime version.
A project maintainer will reply on this issue soon to ask for additional specifics if needed.
For more information on our triage process please visit our triage overview
rad group create: Creates a group and does not change the workspace
rad environment create: Creates an environment in the current group. Does not change the workspace.
rad workspace show shows the environment but not the group. It will show an environment name even if it is not valid. For example:
$ rad workspace create kubernetes dev --context $(kubectl config current-context) -g group -e dev
Creating workspace...
Set "dev" as current workspace
$ rad group create test
creating resource group "test" in workspace "dev"...
resource group "test" created
$ rad group switch test
Switched to resource group "test"
$ rad environment create test
Creating Environment...
Successfully created environment "test" in resource group "test"
$ rad environment show
The environment "dev" was not found or has been deleted.
The root of the problem is that we are treating resource groups and environments as two independent things. When in fact, it's a hierarchy.
I see two options moving forward:
Clean up the CLI output. For example, when creating an environment:
$ rad environment create dev
Created the 'dev' environment in the 'default' resource group.
Use `rad environment switch` to update the current workspace to use the new environment.
When creating a group or an environment, automatically switch to that group or environment.
$ rad environment create dev
Created the 'dev' environment in the 'default' resource group.
Updated the current workspace 'myWorkspace' to use the 'dev' environment. Use `rad environment switch` to update the current workspace to use the new environment.
Rework the way environments and resource groups work. These two concepts are redundant and cause significant user friction. In an ideal Radius world, the user would just create an environment and not have to worry about resource groups at all. Additionally, the workspace could be simplified to be just the current environment. Imagine:
$ rad environment create dev
Created the 'dev' environment and resource group.
Current working environment is set to 'dev'. Use `rad environment switch` to change.
$ rad environment list
ENVIRONMENT RESOURCE GROUP KUBERNETES CURRENT
dev dev myCluster <--
$ rad environment create test
Created the 'test' environment and resource group.
Current working environment is set to 'test'. Use `rad environment switch` to change.
$ rad environment show
ENVIRONMENT RESOURCE GROUP KUBERNETES CURRENT
dev dev myCluster
test test myCluster <--
$ rad environment switch dev
Current working environment is set to 'dev'.
$ rad environment show
ENVIRONMENT RESOURCE GROUP KUBERNETES CURRENT
dev dev myCluster <--
test test myCluster
$ rad workspace show
Error: Unknown command. Use `rad --help` for a list of commands.
Key changes demonstrated here:
An environment always resided in its own resource group
Current working environment is used rather than workspaces
Users switch between environments. They do not switch workspaces or groups.
👍 We've reviewed this issue and have agreed to add it to our backlog. Please subscribe to this issue for notifications, we'll provide updates when we pick it up.
We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.
For more information on our triage process please visit our triage overview
Closing following an issue audit against Radius main at ec97901 and the current referenced implementations.
The concrete ambiguity in the report is addressed: environment lookup now resolves the selected environment to its full resource ID and the deployment progress message prints that ID, exposing the owning group even when the deployment group differs. Full Radius.Core IDs are looked up in their own scope, with a regression test and merged fix; Applications.Core IDs are also passed through. Group switching intentionally does not change the independently selected environment, preserving the issue's explicit cross-group requirement. The broader workspace redesign alternatives in comments are not necessary to resolve this specified misleading deploy output.
returnnil, clierrors.Message("Conflict detected: Environment '%s' exists in both Applications.Core and Radius.Core providers. Please specify the full resource ID to disambiguate:\n Applications.Core: %s\n Radius.Core: %s",
Activity
radius-triage commentedon Sep 2, 2025
👋 @nithyatsu Thanks for filing this feature request.
A project maintainer will review this feature request and get back to you soon.
We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.
For more information on our triage process please visit our triage overview
[-]revisit rad environment switch behavior[/-][+]rad deploy should be more explicit about the environment in use. [/+][-]rad deploy should be more explicit about the environment in use. [/-][+]rad deploy should be more explicit about the environment in use[/+][-]rad deploy should be more explicit about the environment in use[/-][+]Improve context Switching Behavior in rad cli to prevent confusing environment usage[/+][-]Improve context Switching Behavior in rad cli to prevent confusing environment usage[/-][+]Improve context switching behavior in rad cli to prevent confusing environment usage for rad deploy[/+][-]Improve context switching behavior in rad cli to prevent confusing environment usage for rad deploy[/-][+]Improve scope switching behavior in rad cli to prevent confusing environment usage for rad deploy[/+][-]Improve scope switching behavior in rad cli to prevent confusing environment usage for rad deploy[/-][+]Clarify rad deploy environment selection when switching scopes[/+][-]Clarify rad deploy environment selection when switching scopes[/-][+]clarify rad deploy environment selection when switching scopes[/+]radius-triage commentedon Sep 2, 2025
👋 @nithyatsu we need more information.
To help us investigate further, we need additional information to reproduce or understand this issue. Please ensure you have steps to reproduce and information about your OS, rad CLI version, and runtime version.
A project maintainer will reply on this issue soon to ask for additional specifics if needed.
For more information on our triage process please visit our triage overview
zachcasper commentedon Sep 2, 2025
Reviewing current behavior:
rad group create: Creates a group and does not change the workspacerad environment create: Creates an environment in the current group. Does not change the workspace.rad workspace showshows the environment but not the group. It will show an environment name even if it is not valid. For example:The root of the problem is that we are treating resource groups and environments as two independent things. When in fact, it's a hierarchy.
I see two options moving forward:
Key changes demonstrated here:
radius-triage commentedon Sep 29, 2025
👍 We've reviewed this issue and have agreed to add it to our backlog. Please subscribe to this issue for notifications, we'll provide updates when we pick it up.
We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.
For more information on our triage process please visit our triage overview
nicolejms commentedon Sep 11, 2026
Closing following an issue audit against Radius main at ec97901 and the current referenced implementations.
The concrete ambiguity in the report is addressed: environment lookup now resolves the selected environment to its full resource ID and the deployment progress message prints that ID, exposing the owning group even when the deployment group differs. Full Radius.Core IDs are looked up in their own scope, with a regression test and merged fix; Applications.Core IDs are also passed through. Group switching intentionally does not change the independently selected environment, preserving the issue's explicit cross-group requirement. The broader workspace redesign alternatives in comments are not necessary to resolve this specified misleading deploy output.
Evidence:
radius/pkg/cli/cmd/deploy/deploy.go
Lines 670 to 692 in ec97901
radius/pkg/cli/cmd/deploy/deploy.go
Lines 364 to 373 in ec97901
radius/pkg/cli/cmd/deploy/deploy.go
Lines 626 to 666 in ec97901
radius/pkg/cli/cmd/deploy/deploy_test.go
Lines 2035 to 2085 in ec97901