Watch Aspire live streamsDocsTry Aspire

AzurePublishingContext Properties

ClassProperties4 members
Represents a context for publishing Azure bicep templates for a distributed application.
ExcludeMainBicepFileSection titled ExcludeMainBicepFilebool
Gets or sets a value indicating whether the root main.bicep file is excluded from the published output.
public bool ExcludeMainBicepFile { get; set; }

Callers of this class might not need main.bicep. A publisher that deploys each resource module directly from its own deployment manifest never consumes the root template. Although Azure.Provisioning can emit that template, a later Bicep compilation can fail for models the individual modules handle correctly. For example, the generated root always passes location to each module, but a tenant-scoped module does not declare a location parameter, resulting in BCP037.

When set to true, AzurePublishingContext.WriteModelAsync still writes every per-resource Bicep module and populates AzurePublishingContext.ParameterLookup and AzurePublishingContext.OutputLookup against AzurePublishingContext.MainInfrastructure. AzurePublishingContext.MainInfrastructure remains available in memory, but it is never built, compiled, or written to disk. The default is false.

MainInfrastructureSection titled MainInfrastructureInfrastructure
Gets the main.bicep infrastructure for the distributed application.
public Infrastructure MainInfrastructure { get; }
OutputLookupSection titled OutputLookupDictionary<BicepOutputReference, ProvisioningOutput>
Gets a dictionary that maps output references to provisioning outputs.
public Dictionary<BicepOutputReference, ProvisioningOutput> OutputLookup { get; }
The value is the Provisioning.ProvisioningOutput of the AzurePublishingContext.MainInfrastructure that was created with the value of the output referenced by the Aspire BicepOutputReference.
ParameterLookupSection titled ParameterLookupDictionary<ParameterResource, ProvisioningParameter>
Gets a dictionary that maps parameter resources to provisioning parameters.
public Dictionary<ParameterResource, ProvisioningParameter> ParameterLookup { get; }
The value is the Provisioning.ProvisioningParameter of the AzurePublishingContext.MainInfrastructure that was created to be filled with the value of the Aspire ApplicationModel.ParameterResource.