# WithOrigin

- Module: [Aspire.Hosting.Azure.FrontDoor](/reference/api/go/aspire.hosting.azure.frontdoor.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`
- Defined on: [`AzureFrontDoorResource`](/reference/api/go/aspire.hosting.azure.frontdoor/azurefrontdoorresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds an origin (backend) to the Azure Front Door resource. Each origin gets its own Front Door endpoint with a distinct `*.azurefd.net` hostname, its own origin group, and a default route.

## Remarks

Add multiple origins (each gets its own Front Door endpoint):
```
var frontDoor = builder.AddAzureFrontDoor("frontdoor")
.WithOrigin(api)
.WithOrigin(web);
```

## Definition

```go
func (AzureFrontDoorResource) WithOrigin(resource IComputeResource) AzureFrontDoorResource
```

## Parameters

- `resource` (`IComputeResource`) -- The resource to add as an origin (e.g., a project, container, or other compute resource with endpoints).

## Returns

[`AzureFrontDoorResource`](/reference/api/go/aspire.hosting.azure.frontdoor/azurefrontdoorresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureFrontDoorResource`](/reference/api/go/aspire.hosting.azure.frontdoor/azurefrontdoorresource.md)
