|
| 1 | +--- |
| 2 | +title: 'Endpoints in Azure Front Door' |
| 3 | +description: Learn about endpoints when using Azure Front Door. |
| 4 | +services: frontdoor |
| 5 | +author: johndowns |
| 6 | +ms.service: frontdoor |
| 7 | +ms.topic: article |
| 8 | +ms.workload: infrastructure-services |
| 9 | +ms.date: 06/22/2022 |
| 10 | +ms.author: jodowns |
| 11 | +--- |
| 12 | + |
| 13 | +# Endpoints in Azure Front Door |
| 14 | + |
| 15 | +In Azure Front Door Standard/Premium, an *endpoint* is a logical grouping of one or more routes that are associated with domain names. Each endpoint is [assigned a domain name](#endpoint-domain-names) by Front Door, and you can associate your own custom domains by using routes. |
| 16 | + |
| 17 | +## How many endpoints should I create? |
| 18 | + |
| 19 | +A Front Door profile can contain multiple endpoints. However, in many situations you might only need a single endpoint. |
| 20 | + |
| 21 | +When you're planning the endpoints to create, consider the following factors: |
| 22 | + |
| 23 | +- If all of your domains use the same or similar route paths, it's probably best to combine them into a single endpoint. |
| 24 | +- If you use different routes and route paths for each domain, consider using separate endpoints, such as by having an endpoint for each custom domain. |
| 25 | +- If you need to enable or disable all of your domains together, consider using a single endpoint. An entire endpoint can be enabled or disabled together. |
| 26 | + |
| 27 | +## Endpoint domain names |
| 28 | + |
| 29 | +Endpoint domain names are automatically generated when you create a new endpoint. Front Door generates a unique domain name based on several components, including: |
| 30 | + |
| 31 | +- The endpoint's name. |
| 32 | +- A pseudorandom hash value, which is determined by Front Door. By using hash values as part of the domain name, Front Door helps to protect against [subdomain takeover](../security/fundamentals/subdomain-takeover.md) attacks. |
| 33 | +- The base domain name for your Front Door environment. This is generally `z01.azurefd.net`. |
| 34 | + |
| 35 | +For example, suppose you have created an endpoint named `myendpoint`. The endpoint domain name might be `myendpoint-mdjf2jfgjf82mnzx.z01.azurefd.net`. |
| 36 | + |
| 37 | +The endpoint domain is accessible when you associate it with a route. |
| 38 | + |
| 39 | +### Reuse of an endpoint domain name |
| 40 | + |
| 41 | +When you delete and redeploy an endpoint, you might expect to get the same pseudorandom hash value, and therefore the same endpoint domain name. Front Door enables you to control how the pseudorandom hash values are reused on an endpoint-by-endpoint basis. |
| 42 | + |
| 43 | +An endpoint's domain can be reused within the same tenant, subscription, or resource group scope level. You can also choose to not allow the reuse of an endpoint domain. By default, your allow reuse of the endpoint domain within the same Azure Active Directory tenant. |
| 44 | + |
| 45 | +You can use Bicep, an Azure Resource Manager template (ARM template), the Azure CLI, or Azure PowerShell to configure the scope level of the endpoint's domain reuse behavior. You can also configure it for all Front Door endpoints in your whole organization by using Azure Policy. The Azure portal uses the scope level you define through the command line once it has been changed. |
| 46 | + |
| 47 | +The following table lists the allowable values for the endpoint's domain reuse behavior: |
| 48 | + |
| 49 | +| Value | Description | |
| 50 | +|--|--| |
| 51 | +| `TenantReuse` | This is the default value. Endpoints with the same name in the same Azure Active Directory tenant receive the same domain label. | |
| 52 | +| `SubscriptionReuse` | Endpoints with the same name in the same Azure subscription receive the same domain label. | |
| 53 | +| `ResourceGroupReuse` | Endpoints with the same name in the same resource group will receive the same domain label. | |
| 54 | +| `NoReuse` | Endpoints will always receive a new domain label. | |
| 55 | + |
| 56 | +> [!NOTE] |
| 57 | +> You can't modify the reuse behavior of an existing Front Door endpoint. The reuse behavior only applies to newly created endpoints. |
| 58 | +
|
| 59 | +The following example shows how to create a new Front Door endpoint with a reuse scope of `SubscriptionReuse`: |
| 60 | + |
| 61 | +# [Azure CLI](#tab/azurecli) |
| 62 | + |
| 63 | +```azurecli |
| 64 | +az afd endpoint create \ |
| 65 | + --resource-group MyResourceGroup \ |
| 66 | + --profile-name MyProfile \ |
| 67 | + --endpoint-name myendpoint \ |
| 68 | + --name-reuse-scope SubscriptionReuse |
| 69 | +``` |
| 70 | + |
| 71 | +# [Azure PowerShell](#tab/azurepowershell) |
| 72 | + |
| 73 | +```azurepowershell |
| 74 | +New-AzFrontDoorCdnEndpoint ` |
| 75 | + -ResourceGroupName MyResourceGroup ` |
| 76 | + -ProfileName MyProfile ` |
| 77 | + -EndpointName myendpoint ` |
| 78 | + -Location global ` |
| 79 | + -AutoGeneratedDomainNameLabelScope SubscriptionReuse |
| 80 | +``` |
| 81 | + |
| 82 | +# [Bicep](#tab/bicep) |
| 83 | + |
| 84 | +```bicep |
| 85 | +resource endpoint 'Microsoft.Cdn/profiles/afdEndpoints@2021-06-01' = { |
| 86 | + name: endpointName |
| 87 | + parent: profile |
| 88 | + location: 'global' |
| 89 | + properties: { |
| 90 | + autoGeneratedDomainNameLabelScope: 'SubscriptionReuse' |
| 91 | + } |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## Next steps |
| 98 | + |
| 99 | +* [Configure an origin](origin.md) for Azure Front Door. |
0 commit comments