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
Copy file name to clipboardExpand all lines: articles/api-center/enable-api-center-portal.md
+72-39Lines changed: 72 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,45 @@
1
1
---
2
-
title: Enable API Center portal - Azure API Center
3
-
description: Enable the API Center portal, an automatically generated website that enables discovery of your API inventory.
2
+
title: Self-host the API Center portal
3
+
description: How to self-host the API Center portal, a customer-managed website that enables discovery of the API inventory in your Azure API center.
4
4
author: dlepow
5
5
ms.service: api-center
6
6
ms.topic: how-to
7
-
ms.date: 03/18/2024
7
+
ms.date: 04/29/2024
8
8
ms.author: danlep
9
9
ms.custom:
10
10
# Customer intent: As an API program manager, I want to enable a portal for developers and other API stakeholders in my organization to discover the APIs in my organization's API center.
11
11
---
12
12
13
-
# Enable your API Center portal
13
+
# Self-host your API Center portal
14
14
15
-
This article shows how to enable your *API Center portal*, an automatically generated website that developers and other stakeholders in your organization can use to discover the APIs in your [API center](overview.md). The portal is hosted by Azure at a unique URL and restricts user access based on Azure role-based access control.
15
+
This article introduces the *API Center portal*, a website that developers and other stakeholders in your organization can use to discover the APIs in your [API center](overview.md). Deploy a reference implementation of the portal from the [API Center portal starter](https://github.com/Azure/APICenter-Portal-Starter.git) repository.
16
16
17
-
> [!IMPORTANT]
18
-
> The Azure-hosted API Center portal is experimental and will be removed from API Center in an upcoming release. You will have an option to self-host an API Center portal for API discovery in an upcoming release.
17
+
:::image type="content" source="media/enable-api-center-portal/api-center-portal-signed-in.png" alt-text="Screenshot of the API Center portal after user sign-in.":::
18
+
19
+
20
+
## About the API Center portal
19
21
22
+
The API Center portal is a website that you can build and host to display the API inventory in your API center. The portal enables developers and other stakeholders in your organization to discover APIs and view API details.
20
23
24
+
You can build and deploy a reference implementation of the portal using code in the [API Center portal starter](https://github.com/Azure/APICenter-Portal-Starter.git) repository. The portal uses the [Azure API Center data plane API](/rest/api/dataplane/apicenter/operation-groups) to retrieve data from your API center. User access to API information is based on Azure role-based access control.
21
25
26
+
The API Center portal reference implementation provides:
27
+
28
+
* A framework for publishing and maintaining a customer-managed API portal using GitHub Actions
29
+
* A portal platform that customers can modify or extend to meet their needs
30
+
* Flexibility to host on different infrastructures, including deployment to services such as Azure Static Web Apps.
22
31
23
32
## Prerequisites
24
33
25
34
* An API center in your Azure subscription. If you haven't created one already, see [Quickstart: Create your API center](set-up-api-center.md).
26
35
27
36
* Permissions to create an app registration in a Microsoft Entra tenant associated with your Azure subscription, and permissions to grant access to data in your API center.
28
37
38
+
* To build and deploy the portal, you need a GitHub account and the following tools installed on your local machine:
39
+
40
+
*[Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
First configure an app registration in your Microsoft Entra ID tenant. The app registration enables the API Center portal to access data from your API center on behalf of a signed-in user.
@@ -36,14 +50,12 @@ First configure an app registration in your Microsoft Entra ID tenant. The app r
36
50
37
51
* Set **Name** to a meaningful name such as *api-center-portal*
38
52
* Under **Supported account types**, select **Accounts in this organizational directory (Single tenant)**.
39
-
* In **Redirect URI**, select **Single-page application (SPA)** and enter the following URI, substituting your API center name and region where indicated:
* In **Redirect URI**, select **Single-page application (SPA)** and set the URI.
44
54
55
+
* For local testing, set the URI to `http://localhost:5173`.
56
+
* For production, set the URI to the URI of your API Center portal deployment.
45
57
* Select **Register**.
46
-
1. On the **Overview** page, copy the **Application (client) ID**. You use this value when you configure the identity provider for the portal in your API center.
58
+
1. On the **Overview** page, copy the **Application (client) ID** and the **Directory (tenant) ID**. You set these values when you build the portal.
47
59
48
60
1. On the **API permissions** page, select **+ Add a permission**.
49
61
1. On the **Request API permissions** page, select the **APIs my organization uses** tab. Search for and select **Azure API Center**. You can also search for and select application ID `c3ca1a77-7a87-4dba-b8f8-eea115ae4573`.
@@ -54,41 +66,65 @@ First configure an app registration in your Microsoft Entra ID tenant. The app r
54
66
55
67
:::image type="content" source="media/enable-api-center-portal/configure-app-permissions.png" alt-text="Screenshot of required permissions in Microsoft Entra ID app registration in the portal." lightbox="media/enable-api-center-portal/configure-app-permissions.png":::
56
68
69
+
## Configure local environment
57
70
58
-
## Configure Microsoft Entra ID provider for API Center portal
71
+
Follow these steps to build and test the API Center portal locally.
59
72
60
-
In your API center, configure the Microsoft Entra ID identity provider for the API Center portal.
73
+
1. Clone the [API Center portal starter](https://github.com/Azure/APICenter-Portal-Starter.git) repository to your local machine.
61
74
62
-
1. In the [Azure portal](https://portal.azure.com), navigate to your API center.
63
-
1. In the left menu, under **API Center portal**, select **Portal settings**.
64
-
1. Select **Identity provider** > **Start set up**.
65
-
1.On the **Set up user sign-in with Microsoft Entra ID** page, in **Client ID**, enter the **Application (client) ID** of the app registration that you created in the previous section.
1. Change to the `APICenter-Portal-Starter` directory.
66
79
67
-
:::image type="content" source="media/enable-api-center-portal/set-up-sign-in-portal.png" alt-text="Screenshot of the Microsoft Entra ID provider settings in the API Center portal." lightbox="media/enable-api-center-portal/set-up-sign-in-portal.png":::
80
+
```bash
81
+
cd APICenter-Portal-Starter
82
+
```
83
+
1. Check out the main branch.
68
84
69
-
1. Select **Save + publish**. The Microsoft Entra ID provider appears on the **Identity provider** page.
85
+
```bash
86
+
git checkout main
87
+
```
88
+
1. To configure the service, edit the `public/config.json` file to point to your service. Update the values in the file as follows:
89
+
* Replace `<service name>` and `<region>` with the name of your API center and the region where it's deployed
90
+
* Replace `<client ID>` and `<tenant ID>` with the **Application (client) ID** and **Directory (tenant) ID** of the app registration you created in the previous section.
91
+
* Update the value of `title` to a name that you want to appear on the portal.
70
92
71
-
1. To view the API Center portal, on the **Portal settings** page, select **View API Center portal**.
The portal is published at the following URL that you can share with developers in your organization: `https://<api-center-name>.<region>.azure-apicenter.ms`.
106
+
1. Start the development server to test the portal locally.
74
107
75
-
:::image type="content" source="media/enable-api-center-portal/api-center-portal-home.png" alt-text="Screenshot of the API Center portal home page.":::
108
+
```bash
109
+
npm start
110
+
```
76
111
77
-
## Customize portal name
112
+
Browse to the portal at `https://localhost:5173`.
78
113
79
-
By default, the name that appears on the upper left of the API Center portal is the name of your API center. You can customize this name.
114
+
1. When you're ready to build the portal for production, run the following command.
80
115
81
-
1. In the Azure portal, go to the **Portal settings** > **Site profile** page.
82
-
1. Enter a new name in **Add a website name**.
83
-
1. Select **Save + publish**.
116
+
```bash
117
+
npm run build
118
+
```
84
119
85
-
:::image type="content" source="media/enable-api-center-portal/add-website-name.png" alt-text="Screenshot of adding a custom website name in the Azure portal.":::
120
+
## Deploy to Azure
121
+
122
+
For steps to deploy the portal to Azure Static Web Apps, see the [API Center portal starter](https://github.com/Azure/APICenter-Portal-Starter.git) repository.
86
123
87
-
The new name appears after you refresh the API Center portal.
88
124
89
125
## Enable sign-in to portal by Microsoft Entra users and groups
90
126
91
-
While the portal URL is publicly accessible, users must sign in to see the APIs in your API center. To enable sign-in, assign the **Azure API Center Data Reader** role to users or groups in your organization, scoped to your API center.
127
+
Users must sign in to see the APIs in your API center. To enable sign-in, assign the **Azure API Center Data Reader** role to users or groups in your organization, scoped to your API center.
92
128
93
129
> [!IMPORTANT]
94
130
> By default, you and other administrators of the API center don't have access to APIs in the API Center portal. Be sure to assign the **Azure API Center Data Reader** role to yourself and other administrators.
@@ -111,8 +147,6 @@ After you configure access to the portal, configured users can sign in to the po
111
147
> [!NOTE]
112
148
> The first user to sign in to the portal is prompted to consent to the permissions requested by the API Center portal app registration. Thereafter, other configured users aren't prompted to consent.
113
149
114
-
:::image type="content" source="media/enable-api-center-portal/api-center-portal-signed-in.png" alt-text="Screenshot of the API Center portal after user sign-in.":::
115
-
116
150
## Troubleshooting
117
151
118
152
### Error: "You are not authorized to access this portal"
@@ -134,10 +168,7 @@ az provider register --namespace Microsoft.ApiCenter
134
168
135
169
If users who have been assigned the **Azure API Center Data Reader** role can't complete the sign-in flow after selecting **Sign in** in the API Center portal, there might be a problem with the configuration of the Microsoft Entra ID identity provider.
136
170
137
-
In the Microsoft Entra app registration, review and, if needed, update the **Redirect URI** settings:
138
-
139
-
* Platform: **Single-page application (SPA)**
140
-
* URI: `https://<api-center-name>.portal.<region>.azure-apicenter.ms`. This value must be the URI shown for the Microsoft Entra ID provider for your API Center portal.
171
+
In the Microsoft Entra app registration, review and, if needed, update the **Redirect URI** settings to ensure that the URI matches the URI of the API Center portal deployment.
141
172
142
173
### Unable to select Azure API Center permissions in Microsoft Entra app registration
143
174
@@ -151,10 +182,12 @@ az provider register --namespace Microsoft.ApiCenter
151
182
152
183
After re-registering the resource provider, try again to request API permissions.
153
184
185
+
## Support policy
186
+
187
+
Provide feedback, request features, and get support for the API Center portal reference implementation in the [API Center portal starter](https://github.com/Azure/APICenter-Portal-Starter.git) repository.
154
188
155
189
## Related content
156
190
157
-
*[Azure CLI reference for API Center](/cli/azure/apic)
158
191
*[What is Azure role-based access control (RBAC)?](../role-based-access-control/overview.md)
159
192
*[Best practices for Azure RBAC](../role-based-access-control/best-practices.md)
160
193
*[Register a resource provider](../azure-resource-manager/management/resource-providers-and-types.md#register-resource-provider)
0 commit comments