You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Honor AsExisting/PublishAsExisting for Azure App Service environments by referencing existing App Service Plans in generated Bicep instead of recreating them. Add ACR pull identity support, skip dashboard summary output when dashboards are disabled, and cover the publish/deploy shapes with App Service tests and snapshots.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -437,6 +469,51 @@ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithDeploymen
437
469
returnbuilder;
438
470
}
439
471
472
+
/// <summary>
473
+
/// Configures the Azure App Service environment to use the supplied <see cref="AzureUserAssignedIdentityResource"/>
474
+
/// as the managed identity that App Service apps use to pull images from the configured container registry
475
+
/// (the <c>AcrPull</c> identity), instead of having Aspire create a new identity and a new <c>AcrPull</c>
476
+
/// role assignment.
477
+
/// </summary>
478
+
/// <param name="builder">The Azure App Service environment to configure.</param>
479
+
/// <param name="identityBuilder">
480
+
/// The resource builder for the user-assigned identity that should be used for image pulls. This identity is
481
+
/// only used for the <c>AcrPull</c> role; it is not assigned as the app service runtime identity.
482
+
/// </param>
483
+
/// <returns>The <see cref="IResourceBuilder{T}"/> for chaining.</returns>
484
+
/// <remarks>
485
+
/// <para>
486
+
/// When this is set, Aspire will not create a new identity or an <c>AcrPull</c> role assignment for the
487
+
/// container registry. The caller is responsible for ensuring the supplied identity already has the required
488
+
/// <c>AcrPull</c> role assignment on the registry, for example by chaining
489
+
/// <c>.WithRoleAssignments(acr, ContainerRegistryBuiltInRole.AcrPull)</c> when adding the identity.
490
+
/// </para>
491
+
/// <para>
492
+
/// This is commonly combined with <c>AsExisting</c> on the App Service environment (App Service Plan) and on
493
+
/// the container registry to deploy websites into a pre-provisioned set of Azure resources without Aspire
494
+
/// emitting any new ACR-pull identity or ACR-pull role-assignment resources.
495
+
/// </para>
496
+
/// <para>
497
+
/// If the Aspire dashboard is enabled, Aspire still provisions the dashboard website and its contributor
498
+
/// identity. Use <see cref="WithDashboard(IResourceBuilder{AzureAppServiceEnvironmentResource}, bool)"/> with
499
+
/// <see langword="false"/> when targeting a fully pre-provisioned App Service Plan that should not receive a
500
+
/// dashboard.
501
+
/// </para>
502
+
/// </remarks>
503
+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="builder"/> or <paramref name="identityBuilder"/> is <see langword="null"/>.</exception>
0 commit comments