Skip to content

Commit cdf8f58

Browse files
committed
draft updates
1 parent 94951f1 commit cdf8f58

File tree

3 files changed

+45
-24
lines changed

3 files changed

+45
-24
lines changed

articles/api-management/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@
318318
items:
319319
- name: API authentication and authorization options
320320
href: authentication-authorization-overview.md
321+
- name: Configure Microsoft Entra ID applications for API access
322+
href: applications.md
321323
- name: Protect your API with Microsoft Entra ID
322324
href: api-management-howto-protect-backend-with-aad.md
323325
- name: Protect your API with Azure AD B2C

articles/api-management/api-management-policy-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: dlepow
77
ms.service: azure-api-management
88
ms.custom: devx-track-dotnet
99
ms.topic: reference
10-
ms.date: 03/07/2023
10+
ms.date: 05/13/2025
1111
ms.author: danlep
1212
---
1313
# API Management policy expressions

articles/api-management/applications.md

Lines changed: 42 additions & 23 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/08/2025
10+
ms.date: 05/13/2025
1111
ms.author: danlep
1212
ms.custom:
1313
---
@@ -69,15 +69,14 @@ This feature enables:
6969
1. In the left menu, select **Manage** > **Roles and administrators**.
7070
1. Select **Application administrator**.
7171
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**.
7373

7474
## Enable application based access for product
7575

7676
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.
7777

7878
The following example uses the **Starter** product, but choose any published product that has at least one API assigned to it.
7979

80-
8180
1. Sign in to the Azure portal at the following test URL:
8281

8382
[`https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applications=true`](https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applications=true)
@@ -92,15 +91,21 @@ The following example uses the **Starter** product, but choose any published pro
9291
:::image type="content" source="media/applications/enable-application-based-access.png" alt-text="Screenshot of enabling application based access in the portal.":::
9392

9493
> [!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.
96101

97-
## Review product application settings
102+
## (Optional) Review product application settings in Microsoft Entra ID
98103

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.
100105

101106
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.
102107

103-
Review application settings in **App registrations**:
108+
To review application settings in **App registrations**:
104109

105110
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
106111
1. Select **All applications**.
@@ -111,13 +116,9 @@ Review application settings in **App registrations**:
111116

112117
:::image type="content" source="media/applications/application-roles.png" alt-text="Screenshot of app roles in the portal.":::
113118

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
115120

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.
121122

122123
* A product must have **Application based access** enabled to be associated with a client application.
123124
* 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
128129
[`https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applications=true`](https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applications=true)
129130
1. Navigate to your API Management instance.
130131
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:
132133
* **Name**: Enter a name for the application.
133134
* **Owner**: Select the owner of the application from the dropdown list of users in the API Management instance.
134135
* **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
137138
:::image type="content" source="media/applications/register-application.png" alt-text="Screenshot of application settings in the portal.":::
138139
1. Select **Register**.
139140

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**.
141157

142-
<!-- Where would client secret show? Should customer store it somewhere? -->
158+
## (Optional) Review client application settings in Microsoft Entra ID
143159

144-
## Review client application settings
160+
Optionally review settings of the client application in Microsoft Entra ID.
145161

146162
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**.
147163

148-
Review application settings in **App registrations**:
164+
To review application settings in **App registrations**:
149165

150166
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
151167
1. Select **All applications**.
@@ -157,13 +173,19 @@ Review application settings in **App registrations**:
157173

158174
:::image type="content" source="media/applications/client-api-permissions.png" alt-text="Screenshot of API permissions in the portal.":::
159175

176+
<!--
177+
160178
## List applications and get secrets in the developer portal
161179
162180
[TBD]
181+
-->
182+
163183

164184
## Create token and use with API call
165185

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.
167189

168190
> [!CAUTION]
169191
> 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
172194

173195

174196
```powershell
175-
176197
# Replace placeholder values with your own values.
177198
178199
$clientId = "00001111-aaaa-2222-bbbb-3333cccc4444" # Client (application) ID of client application
179200
$clientSecret = "******" # Retrieve secret of client application in developer portal
180201
$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
182203
183204
$body = @{
184205
    grant_type    = "client_credentials"
@@ -197,7 +218,6 @@ The token generated in the previous step is used to call a product API. The toke
197218
The following script shows an example call to the echo API.
198219

199220
```powershell
200-
201221
# Gatewate endpoint to call. Update with URI of API operation you want to call.
202222
$uri = "https://<gateway-hostname>/echo/resource?param1=sample"
203223
$headers = @{
@@ -212,7 +232,6 @@ Write-Host "Response:"
212232
$getresponse | ConvertTo-Json -Depth 5
213233
```
214234

215-
216235
## Related content
217236

218237
* [Create and publish a product](api-management-howto-add-products.md)

0 commit comments

Comments
 (0)