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
# Enable API analysis in your API center - self-managed
14
14
15
-
This article explains how to enable API analysis in [Azure API Center](overview.md) by manually setting up a linting engine and triggers. API analysis offers linting capabilities to analyze API definitions in your organization's API center. Linting ensures your API definitions adhere to organizational style rules, generating both individual and summary reports. Use API analysis to identify and correct common errors and inconsistencies in your API definitions.
15
+
This article explains how to enable API analysis in [Azure API Center](overview.md) by manually setting up a linting engine and triggers. These capabilities analyze your API definitions for adherence to organizational style rules, generating both individual and summary reports. API analysis helps identify and correct common errors and inconsistencies in your API definitions.
16
16
17
17
> [!NOTE]
18
-
> In preview, Azure API Center can also automatically set up a linting engine and any required dependencies and triggers. [Learn more](enable-managed-api-analysis-linting.md).
18
+
> In preview, Azure API Center [automatically configures](enable-managed-api-analysis-linting.md) a default linting engine and dependencies for API analysis. If you enable self-managedanalysis as described in this article, you override these built-in features.
title: Managed API linting and analysis - Azure API Center
3
-
description: Enable managed linting of API definitions in your API center to analyze compliance of APIs with the organization's API style guide.
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: 11/01/2024
6
+
ms.date: 12/03/2024
7
7
ms.author: danlep
8
8
author: dlepow
9
9
ms.custom:
10
10
# Customer intent: As an API developer or API program manager, I want to analyze the API definitions in my organization's API center for compliance with my organization's API style guide.
11
11
---
12
12
13
-
# Enable API analysis in your API center - Microsoft managed
13
+
# Analyze APIs in your API center - Microsoft managed
14
14
15
-
This article explains how to enable API analysis in [Azure API Center](overview.md)without having to manage it yourself (preview). API analysis offers linting capabilities to analyze API definitions in your organization's API center. Linting ensures your API definitions adhere to organizational style rules, generating both individual and summary reports. Use API analysis to identify and correct common errors and inconsistencies in your API definitions.
15
+
Your organization's [API center](overview.md)includes built-in, Microsoft-managed linting capabilities (preview)to analyze API definitions for adherence to organizational style rules, generating both individual and summary reports. API analysis identifies and helps you correct common errors and inconsistencies in your API definitions.
16
16
17
-
> [!IMPORTANT]
18
-
> Managed API analysis in API Center sets up a linting engine and necessary dependencies automatically. You can also enable linting and analysis [manually](enable-api-analysis-linting.md) using a custom Azure function. **Disable any function used for manual linting before enabling managed API analysis.**
17
+
With API analysis:
19
18
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
+
* 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.
20
22
21
-
In this scenario:
22
23
23
-
1. Add a linting ruleset (API style guide) in your API center using the Visual Studio Code extension for Azure API Center.
24
-
1. Azure API Center automatically runs linting when you add or update an API definition. It's also triggered for all API definitions when you deploy a ruleset to your API center.
25
-
1. Review API analysis reports in the Azure portal to see how your API definitions conform to the style guide.
26
-
1. Optionally customize the ruleset for your organization's APIs. Test the custom ruleset locally before deploying it to your API center.
24
+
> [!IMPORTANT]
25
+
> 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.**
27
26
28
27
## Limitations
29
28
30
-
* Currently, only OpenAPI specification documents in JSON or YAML format are analyzed.
31
-
* By default, you enable analysis with the [`spectral:oas` ruleset](https://docs.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules). To learn more about the built-in rules, see the [Spectral GitHub repo](https://github.com/stoplightio/spectral/blob/develop/docs/reference/openapi-rules.md).
29
+
* Currently, only OpenAPI and AsyncAPI specification documents in JSON or YAML format are analyzed.
32
30
* Currently, you configure a single ruleset, and it's applied to all OpenAPI definitions in your API center.
33
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#api-center-limits) for the maximum number of API definitions analyzed. Analysis can take a few minutes to up to 24 hours to complete.
34
32
35
33
## Prerequisites
36
34
37
-
* An API center in your Azure subscription. If you haven't created one already, see [Quickstart: Create your API center](set-up-api-center.md).
38
-
*[Visual Studio Code](https://code.visualstudio.com/)
39
-
40
-
* The following Visual Studio Code extensions:
35
+
* An API center in your Azure subscription. If you haven't created one already, see [Quickstart: Create your API center](set-up-api-center.md).
36
+
* For customizing the ruleset, [Visual Studio Code](https://code.visualstudio.com/) and the following Visual Studio Code extensions:
41
37
*[Azure API Center extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=apidev.azure-api-center)
42
-
43
-
> [!IMPORTANT]
44
-
> Enable managed API analysis using the API Center extension's pre-release version. When installing the extension, choose the pre-release version. Switch between release and pre-release versions any time via the extension's **Manage** button in the Extensions view.
45
38
*[Spectral extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=stoplight.spectral)
46
39
47
-
## Enable API analysis using Visual Studio Code
48
-
49
-
To enable API analysis using the default linting ruleset:
50
-
51
-
1. In Visual Studio Code, open a folder that you'll use to manage rulesets for Azure API Center.
52
-
1. Select the Azure API Center icon from the Activity Bar.
53
-
1. In the API Center pane, expand the API center resource in which to enable API analysis.
54
-
1. Right-click **Rules** and select **Enable API Analysis**.
55
-
56
-
:::image type="content" source="media/enable-managed-api-analysis-linting/enable-analysis-visual-studio-code.png" alt-text="Screenshot of enabling API linting and analysis in Visual Studio Code.":::
57
-
58
-
A message notifies you after API analysis is successfully enabled. A folder for your API center is created in `.api-center-rules`, at the root of your working folder. The folder for your API center contains:
59
-
60
-
* A `ruleset.yml` file that defines the default API style guide used by the linting engine.
61
-
* A `functions` folder with an example custom function that you can use to extend the ruleset.
62
-
63
-
With analysis enabled, the linting engine analyzes API definitions in your API center based on the default ruleset and generates API analysis reports.
64
-
65
40
## View API analysis reports
66
41
67
42
View an analysis summary and the analysis reports for your API definitions in the Azure portal. After API definitions are analyzed, the reports list errors, warnings, and information based on the configured API style guide.
68
43
44
+
In the API analysis report, also review the ruleset that was used for the analysis and the history of linting passes.
45
+
69
46
To view an analysis summary in your API center:
70
47
71
48
1. In the portal, navigate to your API center.
@@ -82,12 +59,13 @@ To view an analysis summary in your API center:
82
59
83
60
## Customize ruleset
84
61
85
-
You can customize the default ruleset 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).
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).
86
63
87
64
To customize or replace the ruleset:
88
65
89
-
1. In Visual Studio Code, open the `.api-center-rules` folder at the root of your working folder.
90
-
1. In the folder for the API center resource, open the `ruleset.yml` file.
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.yml` file.
91
69
1. Modify or replace the content as needed.
92
70
1. Save your changes to `ruleset.yml`.
93
71
@@ -103,6 +81,9 @@ Before deploying the custom ruleset to your API center, validate it locally. The
103
81
104
82
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**).
105
83
84
+
> [!TIP]
85
+
> API developers in your organization can also use this local linting capability to help improve their API definitions before registering APIs in your API center.
86
+
106
87
:::image type="content" source="media/enable-managed-api-analysis-linting/validate-local-linting.png" alt-text="Screenshot of linting an API definition in Visual Studio Code." lightbox="media/enable-managed-api-analysis-linting/validate-local-linting.png":::
107
88
108
89
Review the linting results. Make any necessary adjustments to the ruleset and continue to test it locally until it performs the way you want.
@@ -121,4 +102,5 @@ To see the results of linting with the updated ruleset, view the API analysis re
121
102
122
103
## Related content
123
104
105
+
* 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).
124
106
*[Enable API analysis in your API center - self-managed](enable-api-analysis-linting.md)
Copy file name to clipboardExpand all lines: articles/api-center/synchronize-api-management-apis.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ms.custom: devx-track-azurecli
12
12
13
13
# Synchronize APIs from an API Management instance
14
14
15
-
This article shows how to create a link (preview) to an API Management instance so that the instances's APIs are continuously kept up to date in your [API center](overview.md) inventory.
15
+
This article shows how to create a link to an API Management instance so that the instances's APIs are continuously kept up to date in your [API center](overview.md) inventory.
:::image type="content" source="media/api-management-howto-app-insights/apim-app-insights-api-1.png" alt-text="Screenshot of Diagnostic Logs configuration in the portal.":::
304
304
1. Check the **Enable** box.
305
305
1. Select your attached logger in the **Destination** dropdown.
306
306
1. Input **100** as **Sampling (%)** and select the **Always log errors** checkbox.
0 commit comments