Skip to content

Commit 3ce3de4

Browse files
Merge pull request #300625 from dlepow/corsd
[APIM] CORS for dev portal custom domain
2 parents d4b6661 + 5ae5d5e commit 3ce3de4

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

articles/api-management/configure-custom-domain.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: dlepow
77

88
ms.service: azure-api-management
99
ms.topic: how-to
10-
ms.date: 05/09/2025
10+
ms.date: 05/30/2025
1111
ms.author: danlep
1212
ms.custom:
1313
- engagement-fy23
@@ -50,10 +50,10 @@ There are several API Management endpoints to which you can assign a custom doma
5050
| Endpoint | Default |
5151
| -------- | ----------- |
5252
| **Gateway** | Default is: `<apim-service-name>.azure-api.net`. Gateway is the only endpoint available for configuration in the Consumption tier.<br/><br/>The default Gateway endpoint configuration remains available after a custom Gateway domain is added. |
53-
| **Developer portal** | Default is: `<apim-service-name>.developer.azure-api.net` |
54-
| **Management** | Default is: `<apim-service-name>.management.azure-api.net` |
55-
| **Configuration API (v2)** | Default is: `<apim-service-name>.configuration.azure-api.net` |
56-
| **SCM** | Default is: `<apim-service-name>.scm.azure-api.net` |
53+
| **Developer portal** (all tiers except Consumption) | Default is: `<apim-service-name>.developer.azure-api.net` |
54+
| **Management** (classic tiers only) | Default is: `<apim-service-name>.management.azure-api.net` |
55+
| **Self-hosted gateway configuration API (v2)** | Default is: `<apim-service-name>.configuration.azure-api.net` |
56+
| **SCM** (classic tiers only) | Default is: `<apim-service-name>.scm.azure-api.net` |
5757

5858
### Considerations
5959

@@ -62,6 +62,7 @@ There are several API Management endpoints to which you can assign a custom doma
6262
* Only API Management instance owners can use **Management** and **SCM** endpoints internally. These endpoints are less frequently assigned a custom domain name.
6363
* The **Premium** and **Developer** tiers support setting multiple hostnames for the **Gateway** endpoint.
6464
* Wildcard domain names, like `*.contoso.com`, are supported in all tiers except the Consumption tier. A specific subdomain certificate (for example, api.contoso.com) would take precedence over a wildcard certificate (*.contoso.com) for requests to api.contoso.com.
65+
* When configuing a custom domain for the **Developer portal**, you can [enable CORS](enable-cors-developer-portal.md) for the new domain name. This is needed for developer portal visitors to use the interactive console in the API reference pages.
6566

6667
## Domain certificate options
6768

articles/api-management/enable-cors-developer-portal.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: how-to
9-
ms.date: 12/22/2023
9+
ms.date: 05/30/2025
1010
ms.author: danlep
1111
---
1212

1313
# Enable CORS for interactive console in the API Management developer portal
14+
15+
[!INCLUDE [premium-dev-standard-basic-premiumv2-standarv2-basicv2.md](../../includes/api-management-availability-premium-dev-standard-basic-premiumv2-standardv2-basicv2.md)]
16+
1417
Cross-origin resource sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.
1518

1619
To let visitors to the API Management [developer portal](developer-portal-overview.md) use the interactive test console in the API reference pages, enable a [CORS policy](cors-policy.md) for APIs in your API Management instance. If the developer portal's domain name isn't an allowed origin for cross-domain API requests, test console users will see a CORS error.
1720

1821
For certain scenarios, you can configure the developer portal as a CORS proxy instead of enabling a CORS policy for APIs.
1922

20-
[!INCLUDE [premium-dev-standard-basic.md](../../includes/api-management-availability-premium-dev-standard-basic.md)]
21-
2223
## Prerequisites
2324

2425
+ Complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md)
@@ -41,7 +42,6 @@ You can enable a setting to configure a CORS policy automatically for all APIs i
4142

4243
![Screenshot that shows where to check status of your CORS policy in the developer portal.](media/enable-cors-developer-portal/cors-azure-portal.png)
4344

44-
4545
### Enable CORS policy manually
4646

4747
1. Select the **Manually apply it on the global level** link to see the generated policy code.
@@ -57,6 +57,12 @@ You can enable a setting to configure a CORS policy automatically for all APIs i
5757
>
5858
> As a workaround, you can pass the subscription key in a query parameter.
5959
60+
## CORS configuration for custom domain name
61+
62+
If you configure a [custom domain](configure-custom-domain.md) for the developer portal and want visitors to use the test console on API reference pages, ensure that you enable CORS for the custom developer portal domain name.
63+
64+
When configuring the custom domain, you can enable a setting to add an origin for your custom developer portal domain in the CORS policy. If CORS was already enabled for the default domain, both origins will be included in the CORS policy. You can change the CORS policy settings anytime.
65+
6066
## CORS proxy option
6167

6268
For some scenarios (for example, if the API Management gateway is network isolated), you can choose to configure the developer portal as a CORS proxy itself, instead of enabling a CORS policy for your APIs. The CORS proxy routes the interactive console's API calls through the portal's backend in your API Management instance.
@@ -84,4 +90,4 @@ If you [self-host](developer-portal-self-host.md) the developer portal, the foll
8490
## Related content
8591

8692
* For more information about configuring a policy, see [Set or edit policies](set-edit-policies.md).
87-
* For details about the CORS policy, see the [cors](cors-policy.md) policy reference.
93+
* For details about the CORS policy, see the [cors](cors-policy.md) policy reference.

0 commit comments

Comments
 (0)