Improve Azure provisioning diagnostics#18132
Conversation
Add structured Azure provisioning failure details, deployment operation summaries, generic highlighted resource properties, and Bicep sample runtime fixes for Azure diagnostics validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18132Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18132" |
There was a problem hiding this comment.
Pull request overview
This PR adds structured Azure provisioning diagnostics to the Aspire hosting pipeline and dashboard. When Azure deployments fail, resources now surface actionable details including the failing Azure provider, resource type/name, target resource ID, error codes, HTTP status, supported locations, and recommended recovery actions. The dashboard receives these diagnostics through a generic "highlighted properties" mechanism that allows resource providers to advertise important properties without hardcoding Azure-specific names in the dashboard.
Changes:
- Introduces
AzureProvisioningFailureDetailsandAzureDeploymentOperationDetailsrecords that parse, normalize, and render ARM error responses and deployment operation summaries into structured diagnostics for commands, resource snapshots, and human-readable messages. - Adds
DisplayNameandIsHighlightedproperties toResourcePropertySnapshotand the gRPC proto, flowing through the snapshot pipeline so the dashboard can show provider-advertised properties by default without requiring the "show all" toggle. - Updates the Bicep playground sample with opt-in SQL policy workaround (clearing default role assignments for restricted subscriptions) and Redis access-key auth via Key Vault, plus the SQL client Azure auth provider package reference.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Azure/AzureProvisioningFailureDetails.cs |
New file: canonical failure details record with ARM error parsing, nested error promotion, recommended actions, and rendering to JSON/properties/messages |
src/Aspire.Hosting.Azure/AzureDeploymentOperationDetails.cs |
New file: deployment operation tracking records and summary type for ARM operation polling |
src/Aspire.Hosting.Azure/Provisioning/Provisioners/BicepProvisioner.cs |
Deployment operation progress tracking loop, failure enrichment with supported locations, deployment-start error handling |
src/Aspire.Hosting.Azure/AzureProvisioningController.cs |
Structured failure command results, Disabled inputs for dynamic loading, failure properties on resource snapshots, orphan warning on state reset |
src/Aspire.Hosting.Azure/AzureBicepResource.cs |
Refactored ExtractDetailedErrorMessage to delegate to AzureProvisioningFailureDetails |
src/Aspire.Hosting.Azure/Provisioning/Internal/DefaultArmClientProvider.cs |
New GetSupportedLocationsAsync and GetDeploymentOperationsAsync implementations with recursive nested-deployment walking |
src/Aspire.Hosting.Azure/Provisioning/Internal/IProvisioningServices.cs |
New GetSupportedLocationsAsync and GetDeploymentOperationsAsync interface methods with default implementations |
src/Aspire.Hosting/ApplicationModel/CustomResourceSnapshot.cs |
Added DisplayName and IsHighlighted properties to ResourcePropertySnapshot |
src/Aspire.Hosting/Dashboard/ResourceSnapshot.cs |
Updated property tuple to include DisplayName and IsHighlighted |
src/Aspire.Hosting/Dashboard/GenericResourceSnapshot.cs |
Updated property mapping to pass DisplayName and IsHighlighted |
src/Shared/CustomResourceSnapshotExtensions.cs |
Updated SetResourceProperty/SetResourcePropertyRange to compare and propagate new properties |
src/Aspire.Hosting/Dashboard/proto/dashboard_service.proto |
Added is_highlighted field to ResourceProperty message |
src/Aspire.Hosting/Dashboard/proto/Partials.cs |
Updated proto mapping to include DisplayName and IsHighlighted |
src/Aspire.Dashboard/ServiceClient/Partials.cs |
Dashboard property mapping with DisplayName and IsHighlighted |
src/Aspire.Dashboard/Model/ResourceViewModel.cs |
Added DisplayName and IsHighlighted to view models; display name resolution prefers provider-set name |
src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor.cs |
Highlighted properties shown by default alongside known properties |
src/Aspire.Hosting.Azure/Resources/AzureProvisioningStrings.resx |
New localized display names for failure properties |
src/Aspire.Hosting.Azure/Resources/AzureProvisioningStrings.Designer.cs |
Auto-generated resource accessors |
src/Aspire.Hosting.Azure/Resources/xlf/*.xlf |
XLF translations (13 language files) |
playground/bicep/BicepSample.AppHost/AppHost.cs |
SQL policy workaround, Redis access-key auth |
playground/bicep/BicepSample.ApiService/BicepSample.ApiService.csproj |
Added Microsoft.Data.SqlClient.Extensions.Azure reference |
Directory.Packages.props |
Added Microsoft.Data.SqlClient.Extensions.Azure version 1.0.0 |
tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceExtensionsTests.cs |
New assertions for Disabled inputs, failure details, recommended actions |
tests/Aspire.Hosting.Azure.Tests/AzureBicepProvisionerTests.cs |
Tests for deployment operation tracking, failure enrichment, stale property clearing |
tests/Aspire.Hosting.Azure.Tests/ProvisioningTestHelpers.cs |
Test helper updates for new ARM client methods |
tests/Aspire.Hosting.Tests/Dashboard/DashboardServiceDataTerminalTests.cs |
Updated tuple signature |
tests/Aspire.Dashboard.Tests/Model/ResourceViewModelTests.cs |
Tests for DisplayName and IsHighlighted mapping |
tests/Aspire.Dashboard.Components.Tests/Controls/ResourceDetailsTests.cs |
Test for highlighted unknown properties in default view |
Copilot's findings
Files not reviewed (1)
- src/Aspire.Hosting.Azure/Resources/AzureProvisioningStrings.Designer.cs: Generated file
- Files reviewed: 39/40 changed files
- Comments generated: 0
Use the same structured Azure failure details for deploy-mode Bicep start failures and failed deployment LROs. Keep successful publish/deploy deterministic by avoiding steady-state operation polling, but do a one-shot operation lookup after LRO failures so deploy output can surface provider-level diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate deploy-mode Azure recommended actions from run-mode resource commands so aspire deploy suggests configuration changes instead of dashboard-only commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Synchronize the change-location command state test with provisioning start instead of polling for a transient resource snapshot that can be missed under CI load. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
//deployment-test |
|
/deployment-test |
JamesNK
left a comment
There was a problem hiding this comment.
Minor performance observations: 3 comments around allocation avoidance on the 2-second polling path. No correctness or security issues found — the diagnostics pipeline logic is sound.
Preserve sensitive highlighted dashboard properties, add stress sample coverage, centralize Azure string comparisons, remove internal DIMs, reduce polling allocations, improve deployment operation diagnostics, and harden Azure command option loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
❓ CLI E2E Tests unknown — 115 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #27489269979 |
Description
Azure provisioning failures can leave users with generic ARM wrapper errors and little guidance about which resource failed or how to recover. This change normalizes Azure provisioning failures, enriches deployment operation details, and surfaces actionable diagnostics in resource state, command results, and
aspire deployoutput.The dashboard stays Azure-agnostic: resource providers can now advertise highlighted properties through generic resource property metadata, and Azure uses that path to highlight provisioning failure details. The Azure-specific parsing and recovery guidance remains in
Aspire.Hosting.Azure.Handled errors and diagnostics
LocationNotAvailableForResourceTypechange-locationcommand with a supported regionAzure:LocationorAzure__Locationto a supported region, then rerun deployment; use--clear-cachewhen cached deployment context must be refreshedResourceGroupBeingDeletedchange-contextwith a different resource group, or wait for deletion to finishAzure:ResourceGrouporAzure__ResourceGroupto a different resource group, or wait for deletion to finishSubscriptionNotFoundchange-contextwith an accessible subscriptionAzure:SubscriptionIdorAzure__SubscriptionIdto a subscription in the selected tenant, and verify account access--clear-cacheto rebuild deployment state, or set a different resource group--clear-cacheto recreate missing resources, or set the correct resource groupServiceModelDeprecatedInvalidResourcePropertiesDeploymentFailedandResourceDeploymentFailuredetails[], including deployment-operationstatusMessage.error.details[]aspire deployprints the promoted provider error instead of only the generic wrapperUser-facing usage
In run mode, Azure resource details and commands can show highlighted properties such as provider, resource type, target resource ID, current location, supported locations, error code, request IDs, and recommended actions without the dashboard hardcoding Azure property names.
In deploy mode, recovery guidance uses deployment configuration instead of dashboard resource commands. Example captured from a full
aspire deployvalidation against the Azure Search playground in an unsupported region:For the Bicep sample policy workaround, the sample-only setting remains opt-in:
{ "Azure": { "Sql": { "ClearDefaultRoleAssignments": "true" } } }Validation
AzureBicepProvisionerTestsaspire deployagainstplayground/AzureSearchEndToEndwith unsupportedaustraliacentrallocationLocationNotAvailableForResourceTypedetails and deploy-safeAzure:Location/Azure__Locationrecommendationaspire deployagainst playground samplesScreenshots / Recordings
Fixes #18109
Checklist
<remarks />and<code />elements on your triple slash comments?