From dc4538f21e6248c9d0cf80d507b962ba842769b7 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 11 Nov 2025 17:12:26 +0800 Subject: [PATCH 1/2] Fix subscription ID not being disabled on Azure provisioning dialog --- .../RunModeProvisioningContextProvider.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs b/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs index 9fcd98a464b..10fd9c33bcb 100644 --- a/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs +++ b/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs @@ -155,26 +155,13 @@ private async Task RetrieveAzureProvisioningOptions(CancellationToken cancellati // show the value as from the configuration and disable the input // there should be no option to change it - inputs.Add(new InteractionInput + InputLoadOptions? subscriptionLoadOptions = null; + if (string.IsNullOrEmpty(_options.SubscriptionId)) { - Name = SubscriptionIdName, - InputType = string.IsNullOrEmpty(_options.SubscriptionId) ? InputType.Choice : InputType.Text, - Label = AzureProvisioningStrings.SubscriptionIdLabel, - Required = true, - AllowCustomChoice = true, - Placeholder = AzureProvisioningStrings.SubscriptionIdPlaceholder, - Disabled = !string.IsNullOrEmpty(_options.SubscriptionId), - Value = _options.SubscriptionId, - DynamicLoading = new InputLoadOptions + subscriptionLoadOptions = new InputLoadOptions { LoadCallback = async (context) => { - if (!string.IsNullOrEmpty(_options.SubscriptionId)) - { - // If subscription ID is not set, we don't need to load options - return; - } - // Get tenant ID from input if tenant selection is enabled, otherwise use configured value var tenantId = context.AllInputs[TenantName].Value ?? string.Empty; @@ -186,8 +173,21 @@ private async Task RetrieveAzureProvisioningOptions(CancellationToken cancellati : []; context.Input.Disabled = false; }, - DependsOnInputs = string.IsNullOrEmpty(_options.SubscriptionId) ? [TenantName] : [] - } + DependsOnInputs = [TenantName] + }; + } + + inputs.Add(new InteractionInput + { + Name = SubscriptionIdName, + InputType = string.IsNullOrEmpty(_options.SubscriptionId) ? InputType.Choice : InputType.Text, + Label = AzureProvisioningStrings.SubscriptionIdLabel, + Required = true, + AllowCustomChoice = true, + Placeholder = AzureProvisioningStrings.SubscriptionIdPlaceholder, + Disabled = true, + Value = _options.SubscriptionId, + DynamicLoading = subscriptionLoadOptions }); inputs.Add(new InteractionInput From 29d200ab2e42ee479c0cb75718aea0fbce2c1b8d Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 11 Nov 2025 18:16:40 +0800 Subject: [PATCH 2/2] Fix location always disabled --- .../Components/Dialogs/InteractionsInputDialog.razor.css | 3 ++- .../Internal/RunModeProvisioningContextProvider.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.css b/src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.css index f9ca65c6010..396f7584a07 100644 --- a/src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.css +++ b/src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.css @@ -8,7 +8,8 @@ .interaction-input-dialog .interaction-input ::deep fluent-text-field, .interaction-input-dialog .interaction-input ::deep fluent-select, -.interaction-input-dialog .interaction-input ::deep fluent-combobox { +.interaction-input-dialog .interaction-input ::deep fluent-combobox, +.interaction-input-dialog .interaction-input ::deep label { width: 75%; /* Prevent long select/combox controls from extending outside the dialog. This can happen when there is very long placeholder text */ max-width: 500px; diff --git a/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs b/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs index 10fd9c33bcb..54b59931c31 100644 --- a/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs +++ b/src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs @@ -197,7 +197,7 @@ private async Task RetrieveAzureProvisioningOptions(CancellationToken cancellati Label = AzureProvisioningStrings.LocationLabel, Placeholder = AzureProvisioningStrings.LocationPlaceholder, Required = true, - Disabled = true, + Disabled = string.IsNullOrEmpty(_options.SubscriptionId), DynamicLoading = new InputLoadOptions { LoadCallback = async (context) => @@ -209,7 +209,7 @@ private async Task RetrieveAzureProvisioningOptions(CancellationToken cancellati context.Input.Options = locationOptions; context.Input.Disabled = false; }, - DependsOnInputs = [SubscriptionIdName] + DependsOnInputs = string.IsNullOrEmpty(_options.SubscriptionId) ? [SubscriptionIdName] : [] } });