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-managed-api-analysis-linting.md
+37-15Lines changed: 37 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Managed API linting and analysis - Azure API Center
3
3
description: Automatic linting of API definitions in your API center helps you analyze compliance of APIs with the organization's API style guide.
4
4
ms.service: azure-api-center
5
5
ms.topic: how-to
6
-
ms.date: 12/03/2024
6
+
ms.date: 03/31/2025
7
7
ms.author: danlep
8
8
author: dlepow
9
9
ms.custom:
@@ -18,17 +18,15 @@ With API analysis:
18
18
19
19
* Azure API Center automatically analyzes your API definitions whenever you add or update an API definition. API definitions are linted by default with a [spectral:oas ruleset](https://docs.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules) (API style guide).
20
20
* API analysis reports are generated in the Azure portal, showing how your API definitions conform to the style guide.
21
-
* You can use the Azure API Center extension for Visual Studio Code to customize and test your own API style guide locally and then deploy it to your API center.
22
-
21
+
* Use analysis profiles to specify the ruleset and filter conditions for the APIs that are analyzed. Customize a profile's ruleset using the Azure API Center extension for Visual Studio Code.
23
22
24
23
> [!IMPORTANT]
25
24
> If you prefer, you can enable [self-managed](enable-api-analysis-linting.md) linting and analysis using a custom Azure function, overriding the built-in capabilities. **Disable any function used for self-managed linting before using managed API analysis.**
26
25
27
26
## Limitations
28
27
29
28
* Currently, only OpenAPI and AsyncAPI specification documents in JSON or YAML format are analyzed.
30
-
* Currently, you configure a single ruleset, and it's applied to all OpenAPI definitions in your API center.
31
-
* There are [limits](../azure-resource-manager/management/azure-subscription-service-limits.md?toc=/azure/api-center/toc.json&bc=/azure/api-center/breadcrumb/toc.json#azure-api-center-limits) for the maximum number of API definitions analyzed. Analysis can take a few minutes to up to 24 hours to complete.
29
+
* There are [limits](../azure-resource-manager/management/azure-subscription-service-limits.md?toc=/azure/api-center/toc.json&bc=/azure/api-center/breadcrumb/toc.json#azure-api-center-limits) for the number of analysis profiles and the maximum number of API definitions analyzed. Analysis can take a few minutes to up to 24 hours to complete.
32
30
33
31
## Prerequisites
34
32
@@ -57,27 +55,50 @@ To view an analysis summary in your API center:
57
55
> [!TIP]
58
56
> You can also view the API analysis report by selecting **Analysis** from the API definition's menu bar.
59
57
60
-
## Customize ruleset
58
+
## Manage analysis profiles
59
+
60
+
Azure API Center uses *analysis profiles* for linting and analyzing APIs. An analysis profile specifies a ruleset and optionally filter conditions for APIs that are analyzed. The default analysis profile applies the `spectral:oas` ruleset to all OpenAPI and AsyncAPI definitions.
61
+
62
+
You can customize the ruleset and define filter conditions in the default profile, or you can create a new profile. For example, you might want to use one profile for APIs that are in development and a different one for APIs that are in production.
63
+
64
+
> [!NOTE]
65
+
> In the Standard plan of API Center, you can create up to 3 analysis profiles. Only a single profile is supported in the Free plan.
66
+
67
+
To create an analysis profile:
68
+
69
+
1. In the Azure portal, navigate to your API center.
70
+
1. In the left-hand menu, under **Governance**, select **API Analysis** > **Manage analysis profiles** > **+ Create analysis profile**.
71
+
1. In the **Create new analysis profile** pane, enter a **Name** and **Description** for the profile.
72
+
1. In **Ruleset**, the analyzer type (linting engine) for the ruleset appears. Currently only Spectral is supported.
73
+
1. Under **Define filter conditions**, add one or more filter conditions for API definitions that the profile is applied to.
74
+
1. Select **Create**.
75
+
76
+
77
+
:::image type="content" source="media/enable-managed-api-analysis-linting/create-analysis-profile.png" alt-text="Screenshot of creating an analysis profile in the portal.":::
78
+
79
+
The profile is created and a ruleset scaffold is created. To view the current ruleset, select the profile, and in the context (...) menu, select **View the ruleset**.
80
+
81
+
Continue to the following sections to customize the ruleset.
61
82
62
-
You can use the Azure API Center extension for Visual Studio Code to customize the default ruleset for your API center or replace it as your organization's API style guide. For example, you can [extend the ruleset](https://docs.stoplight.io/docs/spectral/83527ef2dd8c0-extending-rulesets) or add [custom functions](https://docs.stoplight.io/docs/spectral/a781e290eb9f9-custom-functions).
83
+
### Customize the profile's ruleset
63
84
64
-
To customize or replace the ruleset:
85
+
Use the Visual Studio Code extension for Azure API Center to customize a profile's ruleset. After customizing the ruleset and testing it locally, you can deploy it back to your API center.
65
86
66
87
1. In Visual Studio Code, select the Azure API Center icon from the Activity Bar.
67
-
1.Open the `.api-center-rules` folder at the root of your working folder.
68
-
1.In the folder for your API center resource, open the`ruleset.yml` file.
88
+
1.In the API Center pane, expand the API center resource you are working with, and expand **Profiles**.
89
+
1.Expand the profile you want to modify, and select`ruleset.yaml`.
69
90
1. Modify or replace the content as needed.
70
-
1. Save your changes to `ruleset.yml`.
91
+
1. Save your changes to `ruleset.yaml`.
71
92
72
93
### Test ruleset locally
73
94
74
95
Before deploying the custom ruleset to your API center, validate it locally. The Azure API Center extension for Visual Studio Code provides integrated support for API specification linting with Spectral.
75
96
76
97
1. In Visual Studio Code, use the **Ctrl+Shift+P** keyboard shortcut to open the Command Palette.
77
98
1. Type **Azure API Center: Set active API Style Guide** and hit **Enter**.
78
-
1. Choose **Select Local File** and specify the `ruleset.yml` file that you customized. Hit **Enter**.
99
+
1. Choose **Select Local File** and specify the `ruleset.yaml` file that you customized. Hit **Enter**.
79
100
80
-
This step makes the custom ruleset the active API style guide for linting.
101
+
This step makes the custom ruleset the active API style guide for local linting.
81
102
82
103
Now, when you open an OpenAPI-based API definition file, a local linting operation is automatically triggered in Visual Studio Code. Results are displayed inline in the editor and in the **Problems** window (**View > Problems** or **Ctrl+Shift+M**).
83
104
@@ -94,9 +115,10 @@ To deploy the custom ruleset to your API center:
94
115
95
116
1. In Visual Studio Code, select the Azure API Center icon from the Activity Bar.
96
117
1. In the API Center pane, expand the API center resource in which you customized the ruleset.
97
-
1. Right-click **Rules** and select **Deploy Rules to API Center**.
118
+
1. Expand **Profiles**.
119
+
1. Right-click the profile in which you customized the ruleset, and select **Deploy Rules to API Center**.
98
120
99
-
A message notifies you after the rules are successfully deployed to your API center. The linting engine uses the updated ruleset to analyze API definitions.
121
+
A message notifies you after the rules are successfully deployed to your API center. The linting engine uses the updated ruleset to analyze API definitions in the profile.
100
122
101
123
To see the results of linting with the updated ruleset, view the API analysis reports in the portal.
This article guides you through the process of configuring *virtual network integration* for your Standard v2 or Premium v2 (preview) Azure API Management instance. With virtual network integration, your instance can make outbound requests to APIs hosted in a delegated subnet of a single connected virtual network.
15
+
This article guides you through the process of configuring *virtual network integration* for your Standard v2 or Premium v2 (preview) Azure API Management instance. With virtual network integration, your instance can make outbound requests to APIs that are isolated in a single connected virtual network.
16
16
17
17
When an API Management instance is integrated with a virtual network for outbound requests, the gateway and developer portal endpoints remain publicly accessible. The API Management instance can reach both public and network-isolated backend services.
18
18
19
19
:::image type="content" source="./media/integrate-vnet-outbound/vnet-integration.png" alt-text="Diagram of integrating API Management instance with a virtual network for outbound traffic." :::
20
20
21
-
If you want to inject a Premium v2 API Management instance into a virtual network to isolate both inbound and outbound traffic, see [Inject a Premium v2 instance into a virtual network](inject-vnet-v2.md).
21
+
If you want to inject a Premium v2 (preview) API Management instance into a virtual network to isolate both inbound and outbound traffic, see [Inject a Premium v2 instance into a virtual network](inject-vnet-v2.md).
22
22
23
23
> [!IMPORTANT]
24
24
> * Outbound virtual network integration described in this article is available only for API Management instances in the Standard v2 and Premium v2 tiers. For networking options in the different tiers, see [Use a virtual network with Azure API Management](virtual-network-concepts.md).
@@ -48,7 +48,7 @@ If you want to inject a Premium v2 API Management instance into a virtual networ
48
48
49
49
### Network security group
50
50
51
-
A network security group must be associated with the subnet. No specific rules are required. To set up a network security group, see [Create a network security group](../virtual-network/manage-network-security-group.md).
51
+
A network security group must be associated with the subnet. Configure any network security group rules that you need for the gateway to access your API backends. To set up a network security group, see [Create a network security group](../virtual-network/manage-network-security-group.md).
52
52
53
53
### Subnet delegation
54
54
@@ -76,21 +76,14 @@ You must have at least the following role-based access control permissions on th
76
76
77
77
## Configure virtual network integration
78
78
79
-
This section guides you through the process of configure external virtual network integration for an existing Azure API Management instance.
79
+
This section guides you through the process to configure external virtual network integration for an existing Azure API Management instance. You can also configure virtual network integration when you create a new API Management instance.
80
80
81
81
82
82
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
83
-
1. In the left menu, under **Deployment + Infrastructure**, select **Network**.
84
-
1. On the **Outbound traffic** card, select **virtual network integration**.
85
-
86
-
:::image type="content" source="media/integrate-vnet-outbound/integrate-vnet.png" lightbox="media/integrate-vnet-outbound/integrate-vnet.png" alt-text="Screenshot of virtual network integration in the portal.":::
87
-
88
-
1. In the **Virtual network** blade, enable the **Virtual network** checkbox.
89
-
1. Select the location of your API Management instance.
90
-
1. In **Virtual network**, select the virtual network and the delegated subnet that you want to integrate.
91
-
1. Select **Apply**, and then select **Save**. The virtual network is integrated.
92
-
93
-
:::image type="content" source="media/integrate-vnet-outbound/vnet-settings.png" lightbox="media/integrate-vnet-outbound/vnet-settings.png" alt-text="Screenshot of virtual network settings in the portal.":::
83
+
1. In the left menu, under **Deployment + Infrastructure**, select **Network** > **Edit**.
84
+
1. On the **Network configuration** page, under **Outbound features**, select **Enable** virtual network integration.
85
+
1. Select the virtual network and the delegated subnet that you want to integrate.
86
+
1. Select **Save**. The virtual network is integrated.
0 commit comments