Skip to content

Commit 952820f

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into nw-sfi-06
2 parents 42d0746 + 0e33052 commit 952820f

File tree

97 files changed

+1119
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1119
-206
lines changed

articles/api-center/TOC.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
items:
4747
- name: Use metadata for governance
4848
href: metadata.md
49-
- name: Analyze APIs using linting rules
49+
- name: API analysis - Microsoft managed
50+
href: enable-managed-api-analysis-linting.md
51+
- name: API analysis - self-managed
5052
href: enable-api-analysis-linting.md
5153
- name: Discover shadow APIs with Dev Proxy
5254
href: discover-shadow-apis-dev-proxy.md
@@ -56,7 +58,7 @@
5658
items:
5759
- name: Self-host Azure API Center portal
5860
href: enable-api-center-portal.md
59-
- name: Check if app calls APIs using minimal permissions with Dev Proxy
61+
- name: Check API calls use minimal permissions with Dev Proxy
6062
href: check-minimal-api-permissions-dev-proxy.md
6163
- name: API center management and operations
6264
items:

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ ms.custom: devx-track-azurecli
1010
# Customer intent: As an API program manager, I want to lint the API definitions in my organization's API center and analyze whether my APIs comply with my organization's API style guide.
1111
---
1212

13-
# Enable linting and analysis for API governance in your API center
13+
# Enable API analysis in your API center - self-managed
1414

15-
This article shows how to enable linting to analyze API definitions in your organization's [API center](overview.md) for conformance with your organizations's API style rules. Linting generates an analysis report that you can access in your API center. Use API linting and analysis to detect 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. 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.
16+
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).
1619
1720
> [!VIDEO https://www.youtube.com/embed/m0XATQaVhxA]
1821
1922
## Scenario overview
2023

21-
In this scenario, you analyze API definitions in your API center by using the [Spectral](https://github.com/stoplightio/spectral) open source linting engine. An Azure Functions app runs the linting engine in response to events in your API center. Spectral checks that the APIs defined in a JSON or YAML specification document conform to the rules in a customizable API style guide. A report of API compliance is generated that you can view in your API center.
24+
In this scenario, you analyze API definitions in your API center by using the [Spectral](https://github.com/stoplightio/spectral) open source linting engine. An Azure Functions app runs the linting engine in response to events in your API center. Spectral checks that the APIs defined in a JSON or YAML specification document conform to the rules in a customizable API style guide. An analysis report is generated that you can view in your API center.
2225

2326
The following diagram shows the steps to enable linting and analysis in your API center.
2427

@@ -322,7 +325,7 @@ To view the analysis report for an API definition in your API center:
322325
323326
The **API Analysis Report** opens, and it displays the API definition and errors, warnings, and information based on the configured API style guide. The following screenshot shows an example of an API analysis report.
324327
325-
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-report.png" alt-text="Screenshot of an API analysis report in the portal.":::
328+
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-report.png" alt-text="Screenshot of an API analysis report in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-report.png":::
326329
327330
### API analysis summary
328331
@@ -331,12 +334,13 @@ To view a summary of analysis reports for all API definitions in your API center
331334
1. In the portal, navigate to your API center.
332335
1. In the left-hand menu, under **Governance**, select **API Analysis**. The summary appears.
333336
334-
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-summary.png" alt-text="Screenshot of the API analysis summary in the portal.":::
337+
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-summary.png" alt-text="Screenshot of the API analysis summary in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-summary.png":::
335338
336339
## Related content
337340
338341
Learn more about Event Grid:
339342
343+
* [Enable API analysis in your API center - Microsoft managed](enable-managed-api-analysis-linting.md)
340344
* [System topics in Azure Event Grid](../event-grid/system-topics.md)
341345
* [Event Grid push delivery - concepts](../event-grid/concepts.md)
342346
* [Event Grid schema for Azure API Center](../event-grid/event-schema-api-center.md)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
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.
4+
ms.service: azure-api-center
5+
ms.topic: how-to
6+
ms.date: 08/23/2024
7+
ms.author: danlep
8+
author: dlepow
9+
ms.custom:
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+
---
12+
13+
# Enable API analysis in your API center - Microsoft managed
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.
16+
17+
> [!NOTE]
18+
> With managed linting and analysis, API Center sets up a linting engine and any required dependencies and triggers. You can also enable linting and analysis [manually](enable-api-analysis-linting.md).
19+
20+
In this scenario:
21+
22+
1. Add a linting ruleset (API style guide) in your API center using the Visual Studio Code extension for Azure API Center.
23+
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.
24+
1. Review API analysis reports in the Azure portal to see how your API definitions conform to the style guide.
25+
1. Optionally customize the ruleset for your organization's APIs. Test the custom ruleset locally before deploying it to your API center.
26+
27+
## Limitations
28+
29+
* Currently, only OpenAPI specification documents in JSON or YAML format are analyzed.
30+
* 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).
31+
* Currently, you configure a single ruleset, and it's applied to all OpenAPI definitions in your API center.
32+
33+
## Prerequisites
34+
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+
* [Visual Studio Code](https://code.visualstudio.com/)
37+
38+
* The following Visual Studio Code extensions:
39+
* [Azure API Center extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=apidev.azure-api-center)
40+
41+
> [!IMPORTANT]
42+
> 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.
43+
* [Spectral extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=stoplight.spectral)
44+
45+
## Enable API analysis using Visual Studio Code
46+
47+
To enable API analysis using the default linting ruleset:
48+
49+
1. In Visual Studio Code, open a folder that you'll use to manage rulesets for Azure API Center.
50+
1. Select the Azure API Center icon from the Activity Bar.
51+
1. In the API Center pane, expand the API center resource in which to enable API analysis.
52+
1. Right-click **Rules** and select **Enable API Analysis**.
53+
54+
:::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.":::
55+
56+
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:
57+
58+
* A `ruleset.yml` file that defines the default API style guide used by the linting engine.
59+
* A `functions` folder with an example custom function that you can use to extend the ruleset.
60+
61+
With analysis enabled, the linting engine analyzes API definitions in your API center based on the default ruleset and generates API analysis reports.
62+
63+
## View API analysis reports
64+
65+
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.
66+
67+
To view an analysis summary in your API center:
68+
69+
1. In the portal, navigate to your API center.
70+
1. In the left-hand menu, under **Governance**, select **API Analysis**. The summary appears.
71+
72+
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-summary.png" alt-text="Screenshot of the API analysis summary in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-summary.png":::
73+
74+
1. Optionally select the API Analysis Report icon for an API definition. The definition's API analysis report appears, as shown in the following screenshot.
75+
76+
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-report.png" alt-text="Screenshot of an API analysis report in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-report.png":::
77+
78+
> [!TIP]
79+
> You can also view the API analysis report by selecting **Analysis** from the API definition's menu bar.
80+
81+
## Customize ruleset
82+
83+
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).
84+
85+
To customize or replace the ruleset:
86+
87+
1. In Visual Studio Code, open the `.api-center-rules` folder at the root of your working folder.
88+
1. In the folder for the API center resource, open the `ruleset.yml` file.
89+
1. Modify or replace the content as needed.
90+
1. Save your changes to `ruleset.yml`.
91+
92+
### Test ruleset locally
93+
94+
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.
95+
96+
1. In Visual Studio Code, use the **Ctrl+Shift+P** keyboard shortcut to open the Command Palette.
97+
1. Type **Azure API Center: Set active API Style Guide** and hit **Enter**.
98+
1. Choose **Select Local File** and specify the `ruleset.yml` file that you customized. Hit **Enter**.
99+
100+
This step makes the custom ruleset the active API style guide for linting.
101+
102+
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**).
103+
104+
:::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":::
105+
106+
Review the linting results. Make any necessary adjustments to the ruleset and continue to test it locally until it performs the way you want.
107+
108+
### Deploy ruleset to your API center
109+
110+
To deploy the custom ruleset to your API center:
111+
112+
1. In Visual Studio Code, select the Azure API Center icon from the Activity Bar.
113+
1. In the API Center pane, expand the API center resource in which you customized the ruleset.
114+
1. Right-click **Rules** and select **Deploy Rules to API Center**.
115+
116+
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.
117+
118+
To see the results of linting with the updated ruleset, view the API analysis reports in the portal.
119+
120+
## Related content
121+
122+
* [Enable API analysis in your API center - self-managed](enable-api-analysis-linting.md)
146 KB
Loading
79.1 KB
Loading
63.2 KB
Loading
1.09 MB
Loading

articles/azure-arc/resource-bridge/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ Arc resource bridge supports the following Azure regions:
107107
* South Central US
108108
* Canada Central
109109
* Australia East
110+
* Australia SouthEast
111+
110112
* West Europe
111113
* North Europe
112114
* UK South

0 commit comments

Comments
 (0)