microsoft/aspire · error · DistributedApplicationException
App Service configuration validation failed. See errors…
Error message
App Service configuration validation failed. See errors above.
What it means
ValidateAppServiceConfigurationAsync runs a validation step in the publish pipeline that collects App Service configuration errors and reports them through the activity reporter. If any validation errors were found, the step is completed with an error state and a DistributedApplicationException is thrown to halt the pipeline; the actionable details were already printed above this message.
Solutions
- Read the errors printed above this message in the publish output — they identify the exact failing resources and rules.
- Fix each reported App Service configuration issue (environment, registry, slots, customizations).
- Re-run publish and confirm the 'App Service configuration validated' success step completes.
- If errors are unclear, run with more verbose output to capture the per-error reporter entries.
Example fix
// before (workflow) // hit 'App Service configuration validation failed' and stop without reading details // after (workflow) // 1. read the reported validation errors above the throw // 2. fix e.g. missing AddAzureAppServiceEnvironment / registry // 3. re-run publish
Defensive patterns
Strategy: try-catch
Try / catch
try { await PublishAsync(); } catch (DistributedApplicationException ex) when (ex.Message.StartsWith("App Service configuration validation failed")) { // per-resource errors were already reported above; surface the full publish log to the user } Prevention
- Always read the reported validation entries above this aggregate error before changing config.
- Run publish locally before CI to catch App Service config violations early.
- Keep App Service environment, registry, and slot configuration consistent across profiles.
When it happens
Trigger: Publishing an AppHost whose App Service resources violate configuration rules — the individual rule failures (reported earlier in the output) trigger this aggregate throw from the validation step, invoked via validateStep.
Common situations: Invalid or conflicting App Service settings (missing environment, bad registry, slot issues) during publish-mode runs; CI publish runs failing after per-resource validation messages appear in logs.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- An Azure principal parameter was not supplied a value…
- App Service context not found for resource
- App Service plan id ' ' does not contain a resource group…
- Application Insights must be omitted, a location string, a…
- ASPIRERADIUS011
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/086ffbc65330c957.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs:307
// Context not found for this resource - skip
}
}
if (errors.Count > 0)
{
// Report each error through the activity reporter for user-friendly display
foreach (var error in errors)
{
context.ReportingStep.Log(LogLevel.Error, error);
}
await context.ReportingStep.CompleteAsync(
"App Service configuration validation failed",
CompletionState.CompletedWithError,
context.CancellationToken).ConfigureAwait(false);
// Throw to stop the pipeline - the error has already been reported through the activity reporter
throw new DistributedApplicationException("App Service configuration validation failed. See errors above.");
}
await context.ReportingStep.CompleteAsync(
"App Service configuration validated",
CompletionState.Completed,
context.CancellationToken).ConfigureAwait(false);
}
private static string? ValidateEnvironmentVariableNames(IResource resource, AzureAppServiceWebsiteContext appServiceContext)
{
if (resource.HasAnnotationOfType<AzureAppServiceIgnoreEnvironmentVariableChecksAnnotation>())
{
return null;
}
// Azure App Service removes '-' from environment variable names at runtime.
// This breaks configuration binding for connection strings that use dashed names.
var problematicKeys = appServiceContext.EnvironmentVariables.KeysView on GitHub (pinned to 25830f84bd)