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 9fcd98a464b..54b59931c31 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 @@ -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] : [] } });