You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Deploy Azure Front Door in front of Azure API Management
3
-
description: Learn how to front your API Management instance with an instance of Azure Front Door.
2
+
title: Create Azure Front Door in front of Azure API Management
3
+
description: Learn how to front your API Management instance with Azure Front Door Standard/Premium to provide global HTTPS load balancing, TLS offloading, dynamic request acceleration and other capabilities.
4
4
services: api-management
5
5
author: dlepow
6
6
@@ -9,23 +9,19 @@ ms.topic: how-to
9
9
ms.date: 08/22/2022
10
10
ms.author: danlep
11
11
---
12
-
# Create Front Door in front of Azure API Management
12
+
# Use Front Door Standard in front of Azure API Management
Azure Front Door is a modern application delivery network platform providing a secure, scalable content delivery network (CDN), dynamic site acceleration, and global HTTP(s) load balancing for your global web applications. When used in front of API Management, Front Door is useful for TLS offloading, end-to-end TLS, load balancing, response caching of GET requests, a web application firewall, among other capabilities. For a full list of supported features, see [What is Azure Front Door?](../frontdoor/front-door-overview.md).
15
15
16
-
Azure Front Door is a modern application delivery network platform providing a secure, scalable content delivery network (CDN), dynamic site acceleration, and global HTTP(s) load balancing for your global web applications.
16
+
This article shows how to:
17
17
18
-
Azure Front Door supports ... and offers always-on availability, low latency, SSL offload, health probes, etc. etc. For a full list of supported features, see [What is Azure Front Door?](../frontdoor/front-door-overview.md).
19
-
20
-
This article provides detailed steps to set up Azure Front Door Standard/Premium in front of the API gateway of a publicly accessible Azure API Management instance. It also shows the steps to restrict API Management to accept API traffic only from Azure Front Door. You can configure Front Door in this scenario with either:
21
-
22
-
- A non-networked API Management instance
23
-
- An API Management instance injected in a virtual network in [external mode](api-management-using-with.vnet.md) (currently supported only in the Developer and Premium service tiers)
18
+
* Set up Azure Front Door Standard/Premium in front of a publicly accessible Azure API Management instance: either non-networked, or injected in a virtual network in [external mode](api-management-using-with-vnet.md).
19
+
* Restrict API Management to accept API traffic only from Azure Front Door.
24
20
25
21
## Prerequisites
26
22
27
-
* An API Management instance. The instance must be in the same subscription you use for your Azure Front Door profile. If you choose to use a network-injected instance, it must be deployed in an external VNet.
28
-
* The instance's gateway endpoint can be configured with a [custom domain](). However,if you are going to route traffic using HTTPS via port 443, only certificates from valid certificate authorities can be used at the backend (origin) with Front Door. Certificates from internal CAs or self-signed certificates aren't allowed.
23
+
* An API Management instance.
24
+
* If you choose to use a network-injected instance, it must be deployed in an external VNet. (Virtual network injection is supported in the Developer or Premium service tier.)
29
25
* Import one or more APIs to your API Management instance to confirm routing through Front Door.
30
26
31
27
## Configure Azure Front Door
@@ -34,7 +30,7 @@ This article provides detailed steps to set up Azure Front Door Standard/Premium
34
30
35
31
For steps to create an Azure Front Door Standard/Premium profile, see [Quickstart: Create an Azure Front Door profile - Azure portal](../frontdoor/create-front-door-portal.md). For this article, you may choose a Front Door Standard profile. For a comparison of Front Door Standard and Front Door Premium, see [Tier comparison](../frontdoor/standard-premium/tier-comparison.md).
36
32
37
-
Configure the following settings that are specific to using your API Management instance as a Front Door origin. For an explanation of other settings, see the Front Door quickstart.
33
+
Configure the following settings that are specific to using the gateway endpoint of your API Management instance as a Front Door origin. For an explanation of other settings, see the Front Door quickstart.
38
34
39
35
|Setting |Value |
40
36
|---------|---------|
@@ -47,7 +43,7 @@ Configure the following settings that are specific to using your API Management
47
43
48
44
### Update default origin group
49
45
50
-
After the profile is created, update the default origin group that was created to include an API Management health probe.
46
+
After the profile is created, update the default origin group to include an API Management health probe.
51
47
52
48
1. In the [portal](https://portal.azure.com), go to your Front Door profile.
53
49
1. In the left menu, under **Settings** select **Origin groups** > **default-origin-group**.
@@ -64,56 +60,56 @@ After the profile is created, update the default origin group that was created t
64
60
65
61
:::image type="content" source="media/front-door-api-management/update-origin-group.png" alt-text="Screenshot of updating the default origin group in the portal.":::
66
62
63
+
### Update default route
67
64
68
-
### Update default route [is this needed?]
69
-
70
-
Update the default route that is configured in the profile.
65
+
We recommend updating the default route that is configured in the profile to use HTTPS as the forwarding protocol.
71
66
72
67
1. In the [portal](https://portal.azure.com), go to your Front Door profile.
73
68
1. In the left menu, under **Settings** select **Origin groups**.
74
69
1. Expand **default-origin-group**.
75
70
1. In the context menu (**...**) of **default-rout**, select **Configure route**.
76
-
1. Set **Forwarding protocol** to **Match incoming request** and then select **Update**.
71
+
1. Set **Accepted protocols** to **HTTP and HTTPS**.
72
+
1. Enable **Redirect all traffic to use HTTPS**.
73
+
1. Set **Forwarding protocol** to **HTTPS only** and then select **Update**.
77
74
78
75
79
76
### Test the configuration
80
77
81
-
Test the Front Door profile configuration by calling an API hosted by API Management. First call the API directly through the API Management gateway to ensure that that the API is reachable. Then, call the API through Front Door. To test, you can use a command line client such as `curl` for the calls, or a tool such as [Postman](https://www.getpostman.com).
78
+
Test the Front Door profile configuration by calling an API hosted by API Management. First, call the API directly through the API Management gateway to ensure that the API is reachable. Then, call the API through Front Door. To test, you can use a command line client such as `curl` for the calls, or a tool such as [Postman](https://www.getpostman.com).
82
79
83
80
### Call an API directly through API Management
84
81
85
-
In the following example, an operation in the Demo Conference API hosted by an API Management instance is called directly using Postman. The instance's hostname is in the `azure-api.net` domain. In this example, a valid subscription key is passed using a request header. A successful response shows `200 OK` and returns the expected data:
82
+
In the following example, an operation in the Demo Conference API hosted by an API Management instance is called directly using Postman. The instance's hostname here is in the default`azure-api.net` domain. In this example, a valid subscription key is passed using a request header. A successful response shows `200 OK` and returns the expected data:
86
83
87
84
:::image type="content" source="media/front-door-api-management/test-api-management-gateway.png" alt-text="Screenshot showing calling API Management endpoint directly using Postman.":::
88
85
89
86
### Call an API directly through Front Door
90
87
91
-
92
-
In the following example, the same operation in the Demo Conference API is called using the Front Door endpoint configured for your instance. You can find the Front Door endpoint's hostname on the **Properties** page of your Front Door profile in the portal. The hostname is the `azurefd.net` domain. Again, a successful response shows `200 OK` and returns the expected data:
88
+
In the following example, the same operation in the Demo Conference API is called using the Front Door endpoint configured for your instance. The endpoint's hostname is in the `azurefd.net` domain, and it's shown in the portal on the **Properties** page of your Front Door profile. Again, a successful response shows `200 OK` and returns the expected data:
93
89
94
90
:::image type="content" source="media/front-door-api-management/test-front-door-gateway.png" alt-text="Screenshot showing calling Front Door endpoint using Postman.":::
95
91
96
-
97
92
## Restrict incoming traffic to API Management instance
98
93
99
-
100
-
You can configure API Management policies so that the API Management accepts traffic only from Azure Front Door. You can accomplish this restriction using one or both of the [following methods](../frontdoor/front-door-faq.md#how-do-i-lock-down-the-access-to-my-backend-to-only-azure-front-door-):
94
+
Use API Management policies to ensure that your API Management instance accepts traffic only from Azure Front Door. You can accomplish this restriction using one or both of the [following methods](../frontdoor/front-door-faq.yml#how-do-i-lock-down-the-access-to-my-backend-to-only-azure-front-door-):
101
95
102
96
1. Restrict incoming IP addresses to your API Management instances
103
97
1. Restrict traffic based on value of the `X-Azure-FDID` header
104
-
d
105
98
106
99
### Restrict incoming IP addresses
107
100
108
-
You can configure the [ip-filter](/api-management-access-restriction-policies.md#CheckHTTPHeader) policy to filter incoming requests based on the following Azure infrastructure IP addresses:
109
-
*
110
-
*
101
+
You can configure an inbound [ip-filter](/api-management-access-restriction-policies.md#CheckHTTPHeader) policy in API Management to allow only Front Door-related traffic, which includes:
111
102
103
+
***Front Door's backend IP address space** - Allow IP addresses corresponding to the *AzureFrontDoor.Backend* section in [Azure IP Ranges and Service Tags](https://www.microsoft.com/download/details.aspx?id=56519).
112
104
105
+
> [!NOTE]
106
+
> If your API Management instance is deployed in an external virtual network, accomplish the same restriction instead by adding an inbound network security group rule in the subnet used for your API Management instance. Configure the rule to allow HTTPS traffic from source service tag *AzureFrontDoor.Backend* on port 443.
107
+
108
+
***Azure infrastructure services** - Allow IP addresses 168.63.129.16 and 169.254.169.254.
113
109
114
110
### Check Front Door header
115
111
116
-
You can configure the [check-header](/api-management-access-restriction-policies.md#CheckHTTPHeader) policy to filter incoming requests based on the `X-Azure-FDID` HTTP request header. Azure Front Door sends this header to API Management with its unique Front Door ID. You can find the **Front Door ID** value on the **Overview** page of the Front Door profile in the portal.
112
+
You can configure the [check-header](/api-management-access-restriction-policies.md#CheckHTTPHeader) policy to filter incoming requests based on the `X-Azure-FDID` HTTP request header. Azure Front Door sends this header to API Management with its unique Front Door ID. Find the **Front Door ID** value on the **Overview** page of the Front Door profile in the portal.
117
113
118
114
In the following policy example, the Front Door ID is specified using a [named value](api-management-howto-properties.md) named `FrontDoorId`.
119
115
@@ -123,58 +119,26 @@ In the following policy example, the Front Door ID is specified using a [named v
123
119
</check-header>
124
120
```
125
121
126
-
Requests that are not accompanied by a valid `X-Azure-FDID` header return a `403 Forbidden` response.
127
-
128
-
Restrict Inbound IP
129
-
130
-
Restrict Inbound IP to accept traffic from Azure Front Door's backend IP address space and Azure's infrastructure services only.
131
-
132
-
133
-
134
-
External Virtual Network Type APIM
135
-
136
-
For APIM instance deployed as external VNet mode, we can simply restrict the incoming IP using inbound rule in the network security groups of your APIM subnet.
137
-
138
-
* Allow service tag **AzureFrontDoor.Backend** in inbound rule for port 443. (Is it also needed for port 80?)
139
-
* Also allow incoming traffic from Azure's basic infrastructure services through virtualized host IP addresses: 168.63.129.16 and 169.254.169.254
140
-
* If your APIM service isn’t deployed into Vnet (None for the Virtual Network type), then there’s nowhere you can put the inbound rule in. But you can still leverage APIM IP restriction policy to achieve this goal. See policy doc here: https://docs.microsoft.com/en-us/azure/api-management/api-management-access-restriction-policies#Res....
141
-
142
-
Allow Azure Front Door Backend Ips. Refer AzureFrontDoor.Backend section in Azure IP Ranges and Service Tags for Front Door's IPv4 backend IP address range.
Requests that aren't accompanied by a valid `X-Azure-FDID` header return a `403 Forbidden` response.
153
123
154
124
## (Optional) Configure Front Door for developer portal
155
-
\\
156
125
126
+
Optionally, configure the API Management instance's developer portal as an endpoint in the Front Door profile.
157
127
158
-
## Next steps
159
-
160
-
To automate deployments, see the following Quickstart Templates:
161
-
162
-
*[Front Door Standard/Premium with API Management origin](https://azure.microsoft.com/resources/templates/front-door-standard-premium-api-management-external/)
163
-
128
+
* To add an endpoint and configure a route, see [Configure and endpoint with Front Door manager](../frontdoor/how-to-configure-endpoints.md).
164
129
130
+
* When adding the route, add an origin group and origin settings to represent the developer portal:
165
131
166
-
============
132
+
***Origin type** - Select **Custom**
133
+
***Host name** - Enter the developer portal's hostname, for example, *myapim*.developer.azure-api.net
167
134
135
+
For more information and details about settings, see [How to configure an origin for Azure Front Door](../frontdoor/how-to-configure-origin.md#create-a-new-origin-group).
168
136
137
+
> [!NOTE]
138
+
> If you've configured an Azure AD or Azure AD B2C identity provider for the developer portal, you need to update the corresponding app registration with an additional redirect URL to Front Door. In the app registration, supply the URL for the developer portal endpoint configured in your Front Door profile.
169
139
170
-
* Backend pool - API Management service
171
-
* Health probe settings to gatway: - Path `/status-0123456789abcdef`, HTTPS, GET method, 30 sec interval
172
-
* Health probe settings to developer portal ?
173
-
* Routing rules
174
-
* Gateway - HTTPS only? Match incoming requests?
175
-
176
-
* Developer portal
177
-
178
-
* Considerations for multi-region - regional origins?
140
+
## Next steps
179
141
142
+
* To automate deployments of Front Door with API Management, see the following example Quickstart template: [Front Door Standard/Premium with API Management origin](https://azure.microsoft.com/resources/templates/front-door-standard-premium-api-management-external/)\
180
143
144
+
* Optionally deploy Web Application Firewall (WAF) on Azure Front Door to protect the API Management instance from malicious attacks. For more information, see [Azure Web Application Firewall on Azure Front Door](../web-application-firewall/afds/afds-overview.md).
0 commit comments