microsoft/aspire · error · MissingConfigurationException
Azure provisioning options can't be changed because the…
Error message
Azure provisioning options can't be changed because the interaction service is unavailable.
What it means
EnsureProvisioningOptionsAsync prompts the user for Azure provisioning options (subscription, resource group) through the app host's interaction service (dashboard prompt). When the interaction service is unavailable (headless/non-interactive run, no dashboard) and forcePrompt was requested, prompting is impossible, so a MissingConfigurationException is thrown. Without forcePrompt the method degrades gracefully and just reports whether options exist.
Solutions
- Provide the options non-interactively before running: set AZURE_SUBSCRIPTION_ID and related Azure provisioning environment variables, or supply saved deployment state.
- Don't force prompting in headless environments; pass forcePrompt: false and rely on pre-supplied options.
- Run the AppHost with the dashboard/interaction service available (interactive environment) when prompting is required.
- Pre-create a resource group and persist provisioning options so HasProvisioningOptions() returns true without prompting.
Example fix
// before
await provider.EnsureProvisioningOptionsAsync(forcePrompt: true); // headless CI -> throws
// after
Environment.SetEnvironmentVariable("AZURE_SUBSCRIPTION_ID", subscriptionId);
var available = await provider.EnsureProvisioningOptionsAsync(forcePrompt: false); // no prompt; uses env/persisted options Defensive patterns
Strategy: fallback
Validate before calling
if (forcePrompt && !interactionService.IsAvailable)
{
// supply options via env/deployment state instead of prompting
Environment.SetEnvironmentVariable("AZURE_SUBSCRIPTION_ID", subscriptionId);
}
Type guard
bool CanPrompt(IInteractionService interactionService) => interactionService.IsAvailable;
Try / catch
try
{
await provider.EnsureProvisioningOptionsAsync(forcePrompt: true, ct);
}
catch (MissingConfigurationException ex) when (ex.Message.Contains("interaction service is unavailable"))
{
// fall back to env vars / persisted provisioning options instead of prompting
} Prevention
- In headless/CI environments always provision AZURE_SUBSCRIPTION_ID (and related options) via environment or saved deployment state.
- Use forcePrompt: false when no interactive UI is available.
- Only force prompting in sessions where the dashboard/interaction service is running.
When it happens
Trigger: Calling EnsureProvisioningOptionsAsync(forcePrompt: true) in an environment where IInteractionService.IsAvailable is false — e.g. running the AppHost headless (no dashboard/browser interaction), in CI, or with the dashboard disabled — and no complete options are already persisted.
Common situations: Developers hit this running aspire/dotnet run in a headless terminal or CI pipeline where no dashboard UI can render the prompt, while a code path (or dashboard 'edit options' command) forces re-prompting.
Related errors
- An azure location/region is required. Set the…
- An Azure subscription id is required. Set the…
- Azure provisioning options were not provided.
- A BlobServiceClient could not be configured. Ensure valid…
- A BlobServiceClient could not be configured. Ensure valid…
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/cca8d9997d9c299c.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs:77
var normalizedApplicationName = ResourceGroupNameHelpers.NormalizeResourceGroupName(_environment.ApplicationName.ToLowerInvariant());
if (normalizedApplicationName.Length > maxApplicationNameSize)
{
normalizedApplicationName = normalizedApplicationName[..maxApplicationNameSize];
}
// Run mode always includes random suffix for uniqueness
return $"{prefix}-{normalizedApplicationName}-{suffix}";
}
public async Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default)
{
await RehydrateProvisioningOptionsAsync(cancellationToken).ConfigureAwait(false);
if (!_interactionService.IsAvailable)
{
if (forcePrompt)
{
throw new MissingConfigurationException("Azure provisioning options can't be changed because the interaction service is unavailable.");
}
return HasProvisioningOptions();
}
if (!forcePrompt && HasProvisioningOptions())
{
return true;
}
await _provisioningOptionsLock.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
await RehydrateProvisioningOptionsAsync(cancellationToken).ConfigureAwait(false);
if (!forcePrompt && HasProvisioningOptions())
{View on GitHub (pinned to 25830f84bd)