diff --git a/docs/azure/configure-aca-environments.md b/docs/azure/configure-aca-environments.md index 0fb9c3d7ee..86581aed2e 100644 --- a/docs/azure/configure-aca-environments.md +++ b/docs/azure/configure-aca-environments.md @@ -64,6 +64,32 @@ builder.Build().Run(); Calling this API ensures your existing Azure resources remain consistent and prevents duplication. +## Customize provisioning infrastructure + +All .NET Aspire Azure resources are subclasses of the type. This enables customization of the generated Bicep by providing a fluent API to configure the Azure resources—using the API: + +```csharp +var builder = DistributionApplicationBuilder.Create(args); + +var acaEnv = builder.AddAzureContainerAppEnvironment(Config.ContainEnvironmentName); + +acaEnv.ConfigureInfrastructure(config => +{ + var resources = config.GetProvisionableResources(); + var containerEnvironment = resources.OfType().FirstOrDefault(); + + containerEnvironment.Tags.Add("ExampleKey", "Example value"); +}); +``` + +The preceding code: + +- Chains a call to the API: + - The `infra` parameter is an instance of the type. + - The provisionable resources are retrieved by calling the method. + - The single resource is retrieved. + - A tag is added to the Azure Container Apps environment resource with a key of `ExampleKey` and a value of `Example value`. + ## See also - [.NET Aspire Azure integrations overview](integrations-overview.md)