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-management/applications.md
+42-23Lines changed: 42 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: dlepow
7
7
8
8
ms.service: azure-api-management
9
9
ms.topic: how-to
10
-
ms.date: 05/08/2025
10
+
ms.date: 05/13/2025
11
11
ms.author: danlep
12
12
ms.custom:
13
13
---
@@ -69,15 +69,14 @@ This feature enables:
69
69
1. In the left menu, select **Manage** > **Roles and administrators**.
70
70
1. Select **Application administrator**.
71
71
1. In the left menu, select **Manage** > **Assignments** > **+ Add assignments**.
72
-
1. In the **Add assignments**pane, search for the API Management instance's managed identity by name (the name of the API Management instance), select it, and then select **Add**.
72
+
1. In the **Add assignments**page, search for the API Management instance's managed identity by name (the name of the API Management instance), select it, and then select **Add**.
73
73
74
74
## Enable application based access for product
75
75
76
76
Follow these steps to enable **Application based access** for a product. A product must have this setting enabled to be associated with a client application in later steps.
77
77
78
78
The following example uses the **Starter** product, but choose any published product that has at least one API assigned to it.
79
79
80
-
81
80
1. Sign in to the Azure portal at the following test URL:
@@ -92,15 +91,21 @@ The following example uses the **Starter** product, but choose any published pro
92
91
:::image type="content" source="media/applications/enable-application-based-access.png" alt-text="Screenshot of enabling application based access in the portal.":::
93
92
94
93
> [!TIP]
95
-
> You can also enable the **Application based access** setting when creating a new product.
94
+
> You can also enable the **Application based access** setting when creating a new product.
95
+
96
+
Enabling application based access creates a backend enterprise application in Microsoft Entra ID to represent the product. The backend application ID is displayed in the product's **Properties** page.
97
+
98
+
:::image type="content" source="media/applications/product-application-settings.png" alt-text="Screenshot of product's application settings in the portal.":::
99
+
100
+
This application ID is set as the **Audience** value when creating a client application to access the product. Also use this value when generating a token to call the product API.
96
101
97
-
## Review product application settings
102
+
## (Optional) Review product application settings in Microsoft Entra ID
98
103
99
-
Enabling application based access create a backend enterprise application in Microsoft Entra ID to represent the product.
104
+
Optionally review settings of the backend enterprise application created in Microsoft Entra ID to represent the product.
100
105
101
106
The application is named with the following format: **APIMProductApplication\<product-name\>**. For example, if the product name is **Starter**, the application name is **APIMProductApplicationStarter**. The application has an **App role** defined.
102
107
103
-
Review application settings in **App registrations**:
108
+
To review application settings in **App registrations**:
104
109
105
110
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
106
111
1. Select **All applications**.
@@ -111,13 +116,9 @@ Review application settings in **App registrations**:
111
116
112
117
:::image type="content" source="media/applications/application-roles.png" alt-text="Screenshot of app roles in the portal.":::
113
118
114
-
The backend application ID is also displayed in API management in the product's **Properties** pane. This ID is set as the **Audience** value when creating a client application to access the product. Also use this value when generating a token to call the product API.
119
+
## Register client application to access product
115
120
116
-
:::image type="content" source="media/applications/product-application-settings.png" alt-text="Screenshot of product's application settings in the portal.":::
117
-
118
-
## Create client application to access product
119
-
120
-
Now create a client application that is registered in Microsoft Entra ID and limits access to one or more products.
121
+
Now register a client application that limits access to one or more products.
121
122
122
123
* A product must have **Application based access** enabled to be associated with a client application.
123
124
* Each client application has a single user (owner) in the API Management instance that can access product APIs through the application.
@@ -128,7 +129,7 @@ Now create a client application that is registered in Microsoft Entra ID and lim
1. In the left menu, under **APIs**, select **Applications** > **+ Register application**.
131
-
1. In the **Register an application**pane, enter the following application settings:
132
+
1. In the **Register an application**page, enter the following application settings:
132
133
***Name**: Enter a name for the application.
133
134
***Owner**: Select the owner of the application from the dropdown list of users in the API Management instance.
134
135
***Grant access to selected products**: Select one or more products in the API Management instance that you previously enabled for **Application based access**.
@@ -137,15 +138,30 @@ Now create a client application that is registered in Microsoft Entra ID and lim
137
138
:::image type="content" source="media/applications/register-application.png" alt-text="Screenshot of application settings in the portal.":::
138
139
1. Select **Register**.
139
140
140
-
The application is added to the list of applications on the **Applications** pane. A client secret is automatically generated for the application.
141
+
The application is added to the list of applications on the **Applications** page. Select the application to view details such as the **Client ID**. You need this ID to generate a token to call the product API.
142
+
143
+
> [!TIP]
144
+
> * After creating an application, you can associate it with other products. Select the application on the **Applications** page, and then select **Details** > **Products****+ Add product**.
145
+
> * You can also create or associate an application by editing a product from the **Products** page.
146
+
147
+
## Generate client secret
148
+
149
+
A client secret must be generated for the client application to use the OAuth 2.0 client credentials flow. The secret is valid for one year but can be regenerated at any time.
150
+
151
+
1. On the **Applications** page, select the application that you created.
152
+
1. On the application's **Overview** page, next to **Client Secret**, select **Add secret**.
153
+
1. On the **New client secret** page, select **Generate**.
154
+
155
+
A client secret is generated and displayed in the **Client secret** field. Make sure to copy the secret value and store it securely. You won't be able to retrieve it again after you close the page.
156
+
1. Select **Close**.
141
157
142
-
<!-- Where would client secret show? Should customer store it somewhere? -->
158
+
## (Optional) Review client application settings in Microsoft Entra ID
143
159
144
-
## Review client application settings
160
+
Optionally review settings of the client application in Microsoft Entra ID.
145
161
146
162
The application is named with the following format: **APIMApplication\<product-name\>**. For example, if the product name is **Starter**, the application name is similar to **APIMApplicationStarter**.
147
163
148
-
Review application settings in **App registrations**:
164
+
To review application settings in **App registrations**:
149
165
150
166
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
151
167
1. Select **All applications**.
@@ -157,13 +173,19 @@ Review application settings in **App registrations**:
157
173
158
174
:::image type="content" source="media/applications/client-api-permissions.png" alt-text="Screenshot of API permissions in the portal.":::
159
175
176
+
<!--
177
+
160
178
## List applications and get secrets in the developer portal
161
179
162
180
[TBD]
181
+
-->
182
+
163
183
164
184
## Create token and use with API call
165
185
166
-
A developer or client app can run the following Azure PowerShell scripts to call the client application to generate a token, and then use the token to call a product API in API Management.
186
+
After you enable application-based access for a product and create a client application in API Management, a developer or app can generate a token to call the product's APIs. The token must be included in the `Authorization` header of a request.
187
+
188
+
For example, a developer or client app can run the following Azure PowerShell scripts to call the client application to generate a token, and then use the token to call a product API in API Management.
167
189
168
190
> [!CAUTION]
169
191
> The following scripts are examples for testing purposes only. In production, use a secure method to store and retrieve the client secret.
@@ -172,13 +194,12 @@ A developer or client app can run the following Azure PowerShell scripts to call
172
194
173
195
174
196
```powershell
175
-
176
197
# Replace placeholder values with your own values.
177
198
178
199
$clientId = "00001111-aaaa-2222-bbbb-3333cccc4444" # Client (application) ID of client application
179
200
$clientSecret = "******" # Retrieve secret of client application in developer portal
180
201
$scopeOfOtherApp = "api://55556666-ffff-7777-aaaa-8888bbbb9999/.default" # Value of Audience in product properties
181
-
$tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee" # Your tenant id
202
+
$tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee" # Directory (tenant) ID in Microsoft Entra ID
182
203
183
204
$body = @{
184
205
grant_type = "client_credentials"
@@ -197,7 +218,6 @@ The token generated in the previous step is used to call a product API. The toke
197
218
The following script shows an example call to the echo API.
198
219
199
220
```powershell
200
-
201
221
# Gatewate endpoint to call. Update with URI of API operation you want to call.
0 commit comments