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-analysis-linting.md
+11-18Lines changed: 11 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Perform API linting and analysis - Azure API Center
3
3
description: Configure linting of API definitions in your API center to analyze compliance of APIs with the organization's API style guide.
4
4
ms.service: api-center
5
5
ms.topic: how-to
6
-
ms.date: 03/11/2024
6
+
ms.date: 03/26/2024
7
7
ms.author: danlep
8
8
author: dlepow
9
9
ms.custom: devx-track-azurecli
@@ -85,20 +85,16 @@ Follow these steps to deploy the Azure Functions app that runs the linting funct
85
85
86
86
To enable the function app to access the API center, configure a managed identity for the function app. The following steps show how to enable and configure a system-assigned managed identity for the function app using the Azure portal or the Azure CLI.
87
87
88
-
> [!NOTE]
89
-
> In preview, this scenario requires the Contributor role to be assigned to the function app's managed identity.
90
-
91
-
92
88
#### [Portal](#tab/portal)
93
89
94
90
1. In the Azure portal, navigate to your function app and select **Identity** under the **Settings** section.
95
91
1. On the **System assigned** tab, set the **Status** to **On** and then select **Save**.
96
92
97
-
Now that the managed identity is enabled, assign it the Contributor role to access the API center.
93
+
Now that the managed identity is enabled, assign it the Azure API Center Compliance Manager role to access the API center.
98
94
99
-
1. In the Azure portal, navigate to your API center and select **Access control (IAM)**.
95
+
1. In the [Azure portal](https://portal.azure.com), navigate to your API center and select **Access control (IAM)**.
100
96
1. Select **+ Add > Add role assignment**.
101
-
1. Select **Privileged administrator roles** and then select **Contributor**. Select **Next**.
97
+
1. Select **Job function roles** and then select **Azure API Center Compliance Manager**. Select **Next**.
102
98
1. On the **Members** page, in **Assign access to**, select **Managed identity > + Select members**.
103
99
1. On the **Select managed identities** page, search for and select the managed identity of the function app. Click **Select** and then **Next**.
104
100
1. Review the role assignment, and select **Review + assign**.
@@ -136,12 +132,12 @@ Now that the managed identity is enabled, assign it the Contributor role to acce
136
132
--query "id" --output tsv)
137
133
```
138
134
139
-
1. Assign the function app's managed identity the Contributor role in the API center using the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command.
135
+
1. Assign the function app's managed identity the Azure API Center Compliance Manager role in the API center using the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command.
140
136
141
137
```azurecli
142
138
#! /bin/bash
143
139
az role assignment create \
144
-
--role "Contributor" \
140
+
--role "Azure API Center Compliance Manager" \
145
141
--assignee-object-id $principalID \
146
142
--assignee-principal-type ServicePrincipal \
147
143
--scope $apicID
@@ -150,7 +146,7 @@ Now that the managed identity is enabled, assign it the Contributor role to acce
150
146
```azurecli
151
147
# PowerShell syntax
152
148
az role assignment create `
153
-
--role "Contributor" `
149
+
--role "Azure API Center Compliance Manager" `
154
150
--assignee-object-id $principalID `
155
151
--assignee-principal-type ServicePrincipal `
156
152
--scope $apicID
@@ -164,9 +160,8 @@ Now create an event subscription in your API center to trigger the function app
164
160
165
161
#### [Portal](#tab/portal)
166
162
167
-
1. Sign in to the Azure portal at [https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview](https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview). Currently for this scenario, you must access your API center in the portal at this feature flag.
168
-
1. Navigate to your API center and select **Events**.
169
-
1. Select **Azure Function**.
163
+
1. In the [Azure portal](https://portal.azure.com), navigate to your API center and select **Events**.
164
+
1. On the **Get started** tab, select **Azure Function**.
170
165
1. On the **Create Event Subscription** page, do the following:
171
166
1. Enter a descriptive **Name** for the event subscription, and select **Event Grid Schema**.
172
167
1. In **Topic details**, enter a **System topic name** of your choice.
@@ -251,7 +246,6 @@ To test the event subscription, try uploading or updating an API definition file
251
246
252
247
To confirm that the event subscription was triggered:
253
248
254
-
1. Sign in to the Azure portal at [https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview](https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview).
255
249
1. Navigate to your API center, and select **Events** in the left menu.
256
250
1. Select the **Event Subscriptions** tab and select the event subscription for your function app.
257
251
1. Review the metrics to confirm that the event subscription was triggered and that linting was invoked successfully.
@@ -273,8 +267,7 @@ In the portal, you can also view a summary of analysis reports for all API defin
273
267
274
268
To view the analysis report for an API definition in your API center:
275
269
276
-
1. Sign in to the Azure portal at [https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview](https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview).
277
-
1. Navigate to the API version in your API center where you added or updated an API definition.
270
+
1. In the portal, navigate to the API version in your API center where you added or updated an API definition.
278
271
1. Select **Definitions**, and then select the API definition file that you uploaded or updated.
279
272
1. Select the **Analysis** tab.
280
273
:::image type="content" source="media/enable-api-analysis-linting/analyze-api-definition.png" alt-text="Screenshot of Analysis tab for API definition in the portal.":::
@@ -287,7 +280,7 @@ The **API Analysis Report** opens, and it displays the API definition and errors
287
280
288
281
To view a summary of analysis reports for all API definitions in your API center:
289
282
290
-
1. Sign in to the Azure portal at [https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview](https://portal.azure.com/?Microsoft_Azure_ApiManagement=apicenterpreview).
283
+
1. In the portal, navigate to your API center.
291
284
1. In the left-hand menu, under **Governance**, select **API Analysis**. The summary appears.
292
285
293
286
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-summary.png" alt-text="Screenshot of the API analysis summary in the portal.":::
0 commit comments