microsoft/aspire · error · MissingConfigurationException
Azure provisioning options were not provided.
Error message
Azure provisioning options were not provided.
What it means
CreateProvisioningContextAsync builds the provisioning context (subscription, tenant, resource group, principal) required to provision Azure resources. If EnsureProvisioningOptionsAsync reports that no provisioning options were provided (no subscription/resource group resolved and the user declined or never completed the prompt), the interactive path throws MissingConfigurationException since it cannot construct a context. In non-interactive mode it falls back to the base provider, which applies its own rules (e.g. environment variables).
Solutions
- Complete the Azure provisioning prompt in the dashboard (select subscription and resource group) instead of skipping it.
- Set AZURE_SUBSCRIPTION_ID (and optionally AZURE_LOCATION) in the environment so options resolve without prompting.
- Restore or recreate the deployment state file so persisted provisioning options rehydrate.
- Retry the run and accept the prompt; if the prompt keeps being declined, check for dashboard UI issues blocking interaction.
Example fix
// before // user skips the subscription prompt in dashboard, then provisioning fails // after export AZURE_SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000" export AZURE_LOCATION="eastus" # rerun: options resolve without prompting and CreateProvisioningContextAsync succeeds
Defensive patterns
Strategy: fallback
Validate before calling
var optionsSet = !string.IsNullOrEmpty(options.Value.SubscriptionId) || !string.IsNullOrEmpty(options.Value.ResourceGroup);
if (!optionsSet)
{
// seed from environment before building the context
options.Value.SubscriptionId ??= Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
}
Type guard
bool HasProvisioningOptions(AzureProvisionerOptions o) =>
!string.IsNullOrWhiteSpace(o.SubscriptionId) || !string.IsNullOrWhiteSpace(o.ResourceGroup); Try / catch
try
{
var context = await provider.CreateProvisioningContextAsync(ct);
}
catch (MissingConfigurationException ex) when (ex.Message.Contains("options were not provided"))
{
// set AZURE_SUBSCRIPTION_ID / AZURE_LOCATION, or re-run and complete the dashboard prompt
} Prevention
- Never skip/cancel the dashboard provisioning prompt on first run of an AppHost with Azure resources.
- Set AZURE_SUBSCRIPTION_ID (and AZURE_LOCATION) in the environment for non-interactive runs.
- Keep the deployment state file intact so persisted options rehydrate on later runs.
When it happens
Trigger: Calling CreateProvisioningContextAsync in run mode when the interaction service IS available but no options exist — the user cancelled the dashboard prompt, never entered a subscription id, or no persisted deployment state was found — and EnsureProvisioningOptionsAsync(forcePrompt: false) returned false.
Common situations: Developers hit this when they dismiss or skip the Azure subscription prompt in the dashboard the first time they run an AppHost with Azure resources, or when previously saved provisioning state was cleared/corrupted so rehydration finds nothing.
Related errors
- An azure location/region is required. Set the…
- An Azure subscription id is required. Set the…
- Azure provisioning options can't be changed because the…
- 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/16932fa589c14502.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs:135
finally
{
_provisioningOptionsLock.Release();
}
}
public override async Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
{
await RehydrateProvisioningOptionsAsync(cancellationToken).ConfigureAwait(false);
var result = await EnsureProvisioningOptionsAsync(forcePrompt: false, cancellationToken).ConfigureAwait(false);
if (!result)
{
if (!_interactionService.IsAvailable)
{
return await base.CreateProvisioningContextAsync(cancellationToken).ConfigureAwait(false);
}
throw new MissingConfigurationException("Azure provisioning options were not provided.");
}
return await base.CreateProvisioningContextAsync(cancellationToken).ConfigureAwait(false);
}
public async Task PersistProvisioningOptionsAsync(CancellationToken cancellationToken = default)
{
if (string.IsNullOrEmpty(_options.ResourceGroup))
{
_options.ResourceGroup = GetDefaultResourceGroupName();
_options.AllowResourceGroupCreation ??= true;
}
await SaveProvisioningOptionsAsync(_options.ResourceGroup, cancellationToken).ConfigureAwait(false);
}
public async Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default)
{View on GitHub (pinned to 25830f84bd)