Skip to content

Commit 90d4c59

Browse files
author
gitName
committed
[APIC] Analsis profiles
1 parent 27530be commit 90d4c59

File tree

1 file changed

+35
-22
lines changed

1 file changed

+35
-22
lines changed

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

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ To view an analysis summary in your API center:
5656

5757
> [!TIP]
5858
> You can also view the API analysis report by selecting **Analysis** from the API definition's menu bar.
59-
59+
<!--
6060
## Customize ruleset
6161
6262
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).
@@ -68,6 +68,37 @@ To customize or replace the ruleset:
6868
1. In the folder for your API center resource, open the `ruleset.yaml` file.
6969
1. Modify or replace the content as needed.
7070
1. Save your changes to `ruleset.yaml`.
71+
-->
72+
73+
## Analysis profiles
74+
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.
76+
77+
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.
78+
79+
> [!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.
81+
82+
To create an analysis profile:
83+
84+
1. In the Azure portal, navigate to your API center.
85+
1. In the left-hand menu, under **Governance**, select **API Analysis** > **Manage analysis profiles** > **+ Create analysis profile**.
86+
1. In the **Create new analysis profile** pane, enter a **Name** and **Description** for the profile.
87+
1. In **Ruleset**, the analyzer type (linting engine) for the ruleset appears. Currently only Spectral is supported.
88+
1. Under **Define filter conditions**, add one or more filter conditions for API definitions that the profile is applied to.
89+
1. Select **Create**.
90+
91+
The profile is created and a ruleset scaffold is created.
92+
93+
### Customize the profile's ruleset
94+
95+
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.
96+
97+
1. In Visual Studio Code, select the Azure API Center icon from the Activity Bar.
98+
1. In the API Center pane, expand the API center resource you are working with, and expand **Profiles**.
99+
1. Expand the profile you want to modify, and select `ruleset.yaml`.
100+
1. Modify or replace the content as needed.
101+
1. Save your changes to `ruleset.yaml`.
71102

72103
### Test ruleset locally
73104

@@ -94,31 +125,13 @@ To deploy the custom ruleset to your API center:
94125

95126
1. In Visual Studio Code, select the Azure API Center icon from the Activity Bar.
96127
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**.
128+
1. Expand **Profiles**.
129+
1. Right-click the profile in which you customized the ruleset, and select **Deploy Rules to API Center**.
98130

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.
131+
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.
100132

101133
To see the results of linting with the updated ruleset, view the API analysis reports in the portal.
102134

103-
## Analysis profiles
104-
105-
You can create multiple analysis profiles to use different rulesets with different APIs. 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. The profiles
106-
107-
To create an analysis profile:
108-
109-
1. In the Azure portal, navigate to your API center.
110-
1. In the left-hand menu, under **Governance**, select **API Analysis**.
111-
1. In the API analysis summary, select **Manage analysis profiles** > **+ Create analysis profile**.
112-
1. In the **Create new analysis profile** pane, enter a **Name** and **Description** for the profile.
113-
1. In **Ruleset**, select the analyzer type (linting engine) for the ruleset. Currently only Spectral is supported.
114-
1. Under **Define filter conditions**, add one or more filter conditions for the profile.
115-
1. Select **Create**.
116-
117-
To modify the ruleset:
118-
119-
1. In the Azure portal, navigate to your API center.
120-
121-
122135
## Related content
123136

124137
* To learn more about the default built-in ruleset, see the [Spectral GitHub repo](https://github.com/stoplightio/spectral/blob/develop/docs/reference/openapi-rules.md).

0 commit comments

Comments
 (0)