Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous error when submitting invalid Azure subscription ID #6302

Closed
jasonviviano opened this issue Jun 19, 2023 · 4 comments
Closed

Ambiguous error when submitting invalid Azure subscription ID #6302

jasonviviano opened this issue Jun 19, 2023 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@jasonviviano
Copy link
Contributor

jasonviviano commented Jun 19, 2023

Bug information

Steps to reproduce (required)

  1. Run rad env update default --azure-subscription-id asdfadsfasdfas --azure-resource-group <resource-group>
  2. Deploy an application.

Observed behavior (required)

Error displayed in terminal:

Building app.bicep...
Deploying template 'app.bicep' into environment 'default' from workspace 'default'...

Deployment In Progress...

Error: {
  "code": "InternalServerError",
  "message": "Internal server error."
}

TraceId:  3ea21ff3593e2fdf435cf73260f559e9

Error displayed inside of the Kubernetes deployment pod:

{"timestamp":"2023-06-19T17:48:37.248Z","severity":"INFO","message":"Starting deployment rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f","name":"0","scope":"DeploymentEngine.Engine.RadiusDeploymentEngine","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"f77cc049fa48a8213de7a40242216a6d","spanId":"8fea1b03a5293de3","DeploymentName":"rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f"}
{"timestamp":"2023-06-19T17:48:37.249Z","severity":"ERROR","message":"System.FormatException: The GUID for subscription is invalid radius-dev.    at Azure.Core.ResourceIdentifier.Init(ResourceIdentifier parent, ResourceType resourceType, String resourceName, Boolean isProviderResource, SpecialType specialType)    at Azure.Core.ResourceIdentifier.Init()    at Azure.Core.ResourceIdentifier.GetValue[T](T\u0026 value)    at Azure.Core.ResourceIdentifier.get_ResourceType()    at Azure.ResourceManager.Resources.ResourceGroupResource.ValidateResourceId(ResourceIdentifier id)    at Azure.ResourceManager.ArmClient.GetResourceGroupResource(ResourceIdentifier id)    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.CreateMetadataFromAzure(DeploymentMetadata metadata, String azureSub, String azureRg, TokenCredential credentials) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1845    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.PopulateDeploymentMetadata(DeploymentContextWithScopeDefinition context, DeploymentContent deploymentContent, String originalDeploymentName) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1806    at DeploymentEngine.Engine.TempDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/TempDeploymentEngine.cs:line 289    at DeploymentEngine.Engine.RadiusDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngine.cs:line 71    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessDeploymentRequest(DeploymentRequestContext context, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, InsensitiveConcurrentDictionary\u00601 overwrites, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 206    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessResourceGroupDeploymentRequest(String resourceGroupName, String deploymentName, String originalDeploymentName, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, InsensitiveConcurrentDictionary\u00601 deploymentResourceGroups, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 163    at DeploymentEngine.Controllers.DeploymentUCPController.PutDeployment(Object content, String resourceGroupName, String deploymentName, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 59    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Logged|12_1(ControllerActionInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeFilterPipelineAsync\u003Eg__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Routing.EndpointMiddleware.\u003CInvoke\u003Eg__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)    at DeploymentEngine.Extensibility.ExtensibilityExceptionHandlingMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Extensibility/ExtensibilityExceptionHandlingMiddleware.cs:line 23    at DeploymentEngine.ArmErrorMiddleware.Invoke(HttpContext httpContext) in /src/src/DeploymentEngine/ArmErrorMiddleware.cs:line 31    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.SendAsyncAndPopulateResponseHeaders(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 237    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 155    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.\u003CInvoke\u003Eg__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)","name":"UnhandledException","scope":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"f77cc049fa48a8213de7a40242216a6d","spanId":"8fea1b03a5293de3"}
{"timestamp":"2023-06-19T17:48:40.081Z","severity":"INFO","message":"Starting deployment rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f","name":"0","scope":"DeploymentEngine.Engine.RadiusDeploymentEngine","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"ea084d87cb1e9a97d73e979315dc1079","spanId":"3dfb37187afb7dff","DeploymentName":"rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f"}
{"timestamp":"2023-06-19T17:48:40.083Z","severity":"ERROR","message":"System.FormatException: The GUID for subscription is invalid radius-dev.    at Azure.Core.ResourceIdentifier.Init(ResourceIdentifier parent, ResourceType resourceType, String resourceName, Boolean isProviderResource, SpecialType specialType)    at Azure.Core.ResourceIdentifier.Init()    at Azure.Core.ResourceIdentifier.GetValue[T](T\u0026 value)    at Azure.Core.ResourceIdentifier.get_ResourceType()    at Azure.ResourceManager.Resources.ResourceGroupResource.ValidateResourceId(ResourceIdentifier id)    at Azure.ResourceManager.ArmClient.GetResourceGroupResource(ResourceIdentifier id)    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.CreateMetadataFromAzure(DeploymentMetadata metadata, String azureSub, String azureRg, TokenCredential credentials) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1845    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.PopulateDeploymentMetadata(DeploymentContextWithScopeDefinition context, DeploymentContent deploymentContent, String originalDeploymentName) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1806    at DeploymentEngine.Engine.TempDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/TempDeploymentEngine.cs:line 289    at DeploymentEngine.Engine.RadiusDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngine.cs:line 71    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessDeploymentRequest(DeploymentRequestContext context, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, InsensitiveConcurrentDictionary\u00601 overwrites, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 206    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessResourceGroupDeploymentRequest(String resourceGroupName, String deploymentName, String originalDeploymentName, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, InsensitiveConcurrentDictionary\u00601 deploymentResourceGroups, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 163    at DeploymentEngine.Controllers.DeploymentUCPController.PutDeployment(Object content, String resourceGroupName, String deploymentName, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 59    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Logged|12_1(ControllerActionInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeFilterPipelineAsync\u003Eg__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Routing.EndpointMiddleware.\u003CInvoke\u003Eg__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)    at DeploymentEngine.Extensibility.ExtensibilityExceptionHandlingMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Extensibility/ExtensibilityExceptionHandlingMiddleware.cs:line 23    at DeploymentEngine.ArmErrorMiddleware.Invoke(HttpContext httpContext) in /src/src/DeploymentEngine/ArmErrorMiddleware.cs:line 31    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.SendAsyncAndPopulateResponseHeaders(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 237    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 155    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.\u003CInvoke\u003Eg__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)","name":"UnhandledException","scope":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"ea084d87cb1e9a97d73e979315dc1079","spanId":"3dfb37187afb7dff"}
{"timestamp":"2023-06-19T17:48:46.693Z","severity":"INFO","message":"Starting deployment rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f","name":"0","scope":"DeploymentEngine.Engine.RadiusDeploymentEngine","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"35dbb35ba1025b2cdaef3ff156523874","spanId":"6e6b24ccddbd16c2","DeploymentName":"rad-deploy-47a05ba1-040e-4314-af9c-c886235e0b1f"}
{"timestamp":"2023-06-19T17:48:46.695Z","severity":"ERROR","message":"System.FormatException: The GUID for subscription is invalid radius-dev.    at Azure.Core.ResourceIdentifier.Init(ResourceIdentifier parent, ResourceType resourceType, String resourceName, Boolean isProviderResource, SpecialType specialType)    at Azure.Core.ResourceIdentifier.Init()    at Azure.Core.ResourceIdentifier.GetValue[T](T\u0026 value)    at Azure.Core.ResourceIdentifier.get_ResourceType()    at Azure.ResourceManager.Resources.ResourceGroupResource.ValidateResourceId(ResourceIdentifier id)    at Azure.ResourceManager.ArmClient.GetResourceGroupResource(ResourceIdentifier id)    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.CreateMetadataFromAzure(DeploymentMetadata metadata, String azureSub, String azureRg, TokenCredential credentials) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1845    at DeploymentEngine.Engine.RadiusDeploymentEngineHost.PopulateDeploymentMetadata(DeploymentContextWithScopeDefinition context, DeploymentContent deploymentContent, String originalDeploymentName) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngineHost.cs:line 1806    at DeploymentEngine.Engine.TempDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/TempDeploymentEngine.cs:line 289    at DeploymentEngine.Engine.RadiusDeploymentEngine\u00601.ProcessDeployment(DeploymentContextWithScopeDefinition deploymentContext, DeploymentContent definition, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, Uri serviceEndpointUri, CancellationToken cancellationToken, InsensitiveDictionary\u00601 functionEvaluationOverwrites) in /src/src/DeploymentEngine/Engine/RadiusDeploymentEngine.cs:line 71    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessDeploymentRequest(DeploymentRequestContext context, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, String originalDeploymentName, Boolean isNestedDeployment, Boolean validateOnly, InsensitiveConcurrentDictionary\u00601 overwrites, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 206    at DeploymentEngine.Controllers.DeploymentUCPController.ProcessResourceGroupDeploymentRequest(String resourceGroupName, String deploymentName, String originalDeploymentName, DeploymentUCPContent deploymentUCPContent, DeploymentContent deploymentContent, InsensitiveConcurrentDictionary\u00601 deploymentResourceGroups, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 163    at DeploymentEngine.Controllers.DeploymentUCPController.PutDeployment(Object content, String resourceGroupName, String deploymentName, CancellationToken cancellationToken) in /src/src/DeploymentEngine/Controllers/DeploymentUCPController.cs:line 59    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Logged|12_1(ControllerActionInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeFilterPipelineAsync\u003Eg__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)    at Microsoft.AspNetCore.Routing.EndpointMiddleware.\u003CInvoke\u003Eg__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)    at DeploymentEngine.Extensibility.ExtensibilityExceptionHandlingMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Extensibility/ExtensibilityExceptionHandlingMiddleware.cs:line 23    at DeploymentEngine.ArmErrorMiddleware.Invoke(HttpContext httpContext) in /src/src/DeploymentEngine/ArmErrorMiddleware.cs:line 31    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.SendAsyncAndPopulateResponseHeaders(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 237    at Azure.Deployments.ApiService.Handlers.RequestCorrelationMiddleware.InvokeAsync(HttpContext context) in /src/src/DeploymentEngine/Middleware/RequestCorrelationMiddleware.cs:line 155    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.\u003CInvoke\u003Eg__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)","name":"UnhandledException","scope":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"35dbb35ba1025b2cdaef3ff156523874","spanId":"6e6b24ccddbd16c2"}
{"timestamp":"2023-06-19T18:06:42.796Z","severity":"INFO","message":"Starting deployment rad-deploy-de8d22b2-febb-4095-83d9-c0606a0105c1","name":"0","scope":"DeploymentEngine.Engine.RadiusDeploymentEngine","serviceName":"deployment.engine","version":"0.0.1\u002B06f08f0a43c38b9a4c5deba59e37d33da893eece","hostName":"bicep-de-6f8d49649d-pg852","traceId":"eed0641590e0b864f52db90dd89277da","spanId":"1c8ab042fcf812c3","DeploymentName":"rad-deploy-de8d22b2-febb-4095-83d9-c0606a0105c1"}

Screenshot:
Screenshot 2023-06-19 at 3 31 13 PM

Desired behavior (required)

Better error output or subscription GUID checking

Workaround (optional)

N/A

System information

rad Version (required)

RELEASE   VERSION   BICEP     COMMIT
edge      b90126b   0.11.60   b90126b97eac3a8597dcf1bfdad3ce9e8e8570b4

Operating system (required)

GitHub Codespace

Additional context

N/A

AB#8309

AB#9507

AB#13539

@shalabhms shalabhms added the good first issue Good for newcomers label Jun 19, 2023
@AaronCrawfis
Copy link
Contributor

Notes from triage:

  • This should be validated in the CLI, as part of the Radius environment, and as part of the deployment engine
  • Adding the good-first-issue tag for the scope of the CLI validation

AaronCrawfis referenced this issue Jun 21, 2023
# Description

Today we accept any string for `--azure-subscription-id`, which can be
confusing if a user tries to use a subscription name instead of a
subscription ID. We also don't have further downstream checks so this
results in a really bad error for users when they do this.

This PR adds CLI validation to make sure the supplied value is a valid
UUID (_but doesn't check if it's a valid Azure subscription, that'll
come later_).

There is still work to do to add additional validation, which will come
as part of a future PR

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Partially addresses #5757

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [x] Adds necessary unit tests for change
* [x] Adds necessary E2E tests for change
* [x] Unit tests passing
* [x] Extended the documentation / Created issue for it

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 6876cc0</samp>

### Summary
🔄🆕✅

<!--
1. 🔄 - This emoji represents the change in the `Validate` function to
use the `RequireAzureSubscriptionId` function instead of directly
getting the flag value.
2. 🆕 - This emoji represents the addition of the new function
`RequireAzureSubscriptionId` to the `cli` package to validate Azure
subscription ID flags for commands.
3. ✅ - This emoji represents the addition and update of test cases for
Azure subscription ID validation in `update_test`.
-->
Added a new function to validate Azure subscription ID flags for `env
update` and other commands. Updated tests to cover the validation logic.

> _Sing, O Muse, of the skillful code review_
> _That brought new order to the update command_
> _And made it heed the azure flag, the true_
> _And valid sign of the subscription's hand._

### Walkthrough
* Import and use `uuid.Parse` and `AzureSubscriptionIdFlag` to validate
Azure subscription ID flag value in `RequireAzureSubscriptionId`
function
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9L25-R28),
[link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9R264-R278))
* Use `RequireAzureSubscriptionId` function in `Validate` function of
`update` command to ensure valid Azure subscription ID before updating
environment
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-5666f913c4913108ef57c2f23dec3f4b6a4fc6bc653f2b0c51982b9619fb6e12L140-R140))
* Add test case to check error when Azure subscription ID flag value is
invalid in `Test_Validate` function of `update_test` file
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L68-R78))
* Modify existing test case to use valid Azure subscription ID flag
value in `Test_Validate` function of `update_test` file
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L78-R87))
nithyatsu referenced this issue Jun 21, 2023
# Description

Today we accept any string for `--azure-subscription-id`, which can be
confusing if a user tries to use a subscription name instead of a
subscription ID. We also don't have further downstream checks so this
results in a really bad error for users when they do this.

This PR adds CLI validation to make sure the supplied value is a valid
UUID (_but doesn't check if it's a valid Azure subscription, that'll
come later_).

There is still work to do to add additional validation, which will come
as part of a future PR

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Partially addresses #5757

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [x] Adds necessary unit tests for change
* [x] Adds necessary E2E tests for change
* [x] Unit tests passing
* [x] Extended the documentation / Created issue for it

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 6876cc0</samp>

### Summary
🔄🆕✅

<!--
1. 🔄 - This emoji represents the change in the `Validate` function to
use the `RequireAzureSubscriptionId` function instead of directly
getting the flag value.
2. 🆕 - This emoji represents the addition of the new function
`RequireAzureSubscriptionId` to the `cli` package to validate Azure
subscription ID flags for commands.
3. ✅ - This emoji represents the addition and update of test cases for
Azure subscription ID validation in `update_test`.
-->
Added a new function to validate Azure subscription ID flags for `env
update` and other commands. Updated tests to cover the validation logic.

> _Sing, O Muse, of the skillful code review_
> _That brought new order to the update command_
> _And made it heed the azure flag, the true_
> _And valid sign of the subscription's hand._

### Walkthrough
* Import and use `uuid.Parse` and `AzureSubscriptionIdFlag` to validate
Azure subscription ID flag value in `RequireAzureSubscriptionId`
function
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9L25-R28),
[link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9R264-R278))
* Use `RequireAzureSubscriptionId` function in `Validate` function of
`update` command to ensure valid Azure subscription ID before updating
environment
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-5666f913c4913108ef57c2f23dec3f4b6a4fc6bc653f2b0c51982b9619fb6e12L140-R140))
* Add test case to check error when Azure subscription ID flag value is
invalid in `Test_Validate` function of `update_test` file
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L68-R78))
* Modify existing test case to use valid Azure subscription ID flag
value in `Test_Validate` function of `update_test` file
([link](https://github.com/project-radius/radius/pull/5758/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L78-R87))
@willtsai willtsai transferred this issue from radius-project/radius Sep 19, 2023
@AaronCrawfis AaronCrawfis transferred this issue from another repository Sep 19, 2023
@ckansara16
Copy link
Contributor

/assign

@ckansara16
Copy link
Contributor

Hello @jasonviviano - Have checked the scenario, error is not triggered in rad version - 0.39.0. have attached screenshot for reference.
rad-issue-6302

@Reshrahim
Copy link
Contributor

@ckansara16 - Thanks for validating! We can resolve the issue.

cc - @willtsai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants