Skip to content

Commit fbccfc7

Browse files
author
gitName
committed
screenshots
1 parent a1099ff commit fbccfc7

File tree

3 files changed

+13
-23
lines changed

3 files changed

+13
-23
lines changed

articles/api-center/enable-managed-api-analysis-linting.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Managed API linting and analysis - Azure API Center
33
description: Automatic linting of API definitions in your API center helps you analyze compliance of APIs with the organization's API style guide.
44
ms.service: azure-api-center
55
ms.topic: how-to
6-
ms.date: 12/03/2024
6+
ms.date: 03/31/2025
77
ms.author: danlep
88
author: dlepow
99
ms.custom:
@@ -18,17 +18,15 @@ With API analysis:
1818

1919
* 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).
2020
* 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.
2322

2423
> [!IMPORTANT]
2524
> 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.**
2625
2726
## Limitations
2827

2928
* 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.
3230

3331
## Prerequisites
3432

@@ -56,28 +54,15 @@ To view an analysis summary in your API center:
5654

5755
> [!TIP]
5856
> You can also view the API analysis report by selecting **Analysis** from the API definition's menu bar.
59-
<!--
60-
## Customize ruleset
61-
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).
63-
64-
To customize or replace the ruleset:
65-
66-
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.yaml` file.
69-
1. Modify or replace the content as needed.
70-
1. Save your changes to `ruleset.yaml`.
71-
-->
7257
73-
## Analysis profiles
58+
## Manage analysis profiles
7459

75-
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. A default profile applies the `spectral:oas` ruleset to all OpenAPI and AsyncAPI definitions.
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.
7661

7762
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.
7863

7964
> [!NOTE]
80-
> In the Standard plan of API Center, you can create up to 3 analysis profiles. Only a single default profile is supported in the Free plan.
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.
8166
8267
To create an analysis profile:
8368

@@ -88,7 +73,12 @@ To create an analysis profile:
8873
1. Under **Define filter conditions**, add one or more filter conditions for API definitions that the profile is applied to.
8974
1. Select **Create**.
9075

91-
The profile is created and a ruleset scaffold is created.
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.
9282

9383
### Customize the profile's ruleset
9484

@@ -108,7 +98,7 @@ Before deploying the custom ruleset to your API center, validate it locally. The
10898
1. Type **Azure API Center: Set active API Style Guide** and hit **Enter**.
10999
1. Choose **Select Local File** and specify the `ruleset.yaml` file that you customized. Hit **Enter**.
110100

111-
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.
112102

113103
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**).
114104

4.93 KB
Loading
123 KB
Loading

0 commit comments

Comments
 (0)