# AzurePublishingContext

- Kind: `class`
- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzurePublishingContext.cs)

Represents a context for publishing Azure bicep templates for a distributed application.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public sealed class AzurePublishingContext
{
    // ...
}
```

## Remarks

This context facilitates the generation of bicep templates using the provided application model, publisher options, and execution context. It handles resource configuration and ensures that the bicep template is created in the specified output path.

## Constructors

- [AzurePublishingContext(string, AzureProvisioningOptions, IServiceProvider, ILogger, IReportingStep)](/reference/api/csharp/aspire.hosting.azure/azurepublishingcontext/constructors.md#constructor-string-azureprovisioningoptions-iserviceprovider-ilogger-ireportingstep) -- Represents a context for publishing Azure bicep templates for a distributed application.

## Properties

- [MainInfrastructure](/reference/api/csharp/aspire.hosting.azure/azurepublishingcontext/properties.md#maininfrastructure) : `Infrastructure` `get` -- Gets the main.bicep infrastructure for the distributed application.
- [OutputLookup](/reference/api/csharp/aspire.hosting.azure/azurepublishingcontext/properties.md#outputlookup) : `Dictionary<BicepOutputReference, ProvisioningOutput>` `get` -- Gets a dictionary that maps output references to provisioning outputs.
- [ParameterLookup](/reference/api/csharp/aspire.hosting.azure/azurepublishingcontext/properties.md#parameterlookup) : `Dictionary<ParameterResource, ProvisioningParameter>` `get` -- Gets a dictionary that maps parameter resources to provisioning parameters.

## Methods

- [WriteModelAsync(DistributedApplicationModel, AzureEnvironmentResource, CancellationToken)](/reference/api/csharp/aspire.hosting.azure/azurepublishingcontext/methods.md#writemodelasync-distributedapplicationmodel-azureenvironmentresource-cancellationtoken) : `Task` -- Writes the specified distributed application model to the output path using Bicep templates.
