# AzureCdnPrivateLinkTarget.WithAzureFrontDoorPrivateLink

- Module: [Aspire.Hosting.Azure.FrontDoor](/reference/api/go/aspire.hosting.azure.frontdoor.md)
- Defined on: [AzureCdnPrivateLinkTarget](/reference/api/go/aspire.hosting.azure.frontdoor/azurecdnprivatelinktarget.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`

Connects an Azure Front Door to a compute environment, such as an Azure Container Apps environment, over Private Link and disables public network access to its apps, so that the apps in the environment are reachable only through the Front Door.

## Remarks

Add the apps to the Front Door with `withOrigin`, before or after this call. Every origin of the Front Door that
runs in the environment becomes a Private Link origin: the Front Door profile uses the Premium SKU, and the origin
connects to the environment through a Front Door managed private endpoint. The apps must expose external HTTP
endpoints. Origins in other compute environments are left as they are.
Public network access to the environment is disabled, so the apps are reachable only through the Front Door. The
Container Apps environment must be a workload profiles environment that Aspire provisions. For App Service,
each origin targets its own website, all workload websites have public access disabled, and with deployment slots
each origin targets the production site; the slot isn't reachable through Front Door, so swap it into production.
The separately provisioned dashboard is unchanged. App Service callers must use Front Door
URLs or their own private networking for service-to-service traffic.
Front Door creates a connection request in the Pending state, and no traffic reaches the apps until the owner of
the environment approves it in the Azure portal or with `az network private-endpoint-connection approve`.

## Definition

```go
type AzureCdnPrivateLinkTarget interface {
    // ... omitted for brevity
    WithAzureFrontDoorPrivateLink(frontDoor AzureFrontDoorResource) AzureCdnPrivateLinkTarget
}
```

## Signature

```go
WithAzureFrontDoorPrivateLink(frontDoor AzureFrontDoorResource) AzureCdnPrivateLinkTarget
```

## Parameters

- `frontDoor` ([`AzureFrontDoorResource`](/reference/api/go/aspire.hosting.azure.frontdoor/azurefrontdoorresource.md)) -- The Azure Front Door, created with `AddAzureFrontDoor`, whose origins in `environment` use Private Link.

## Returns

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

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

## Defined on

- [AzureCdnPrivateLinkTarget](/reference/api/go/aspire.hosting.azure.frontdoor/azurecdnprivatelinktarget.md) -- `interface`
