|
1 | 1 | ---
|
2 | 2 | title: Use Visual Studio Code extension - Azure API Center
|
3 |
| -description: Discover, try, and consume APIs from your Azure API center using the API Center extension for Visual Studio Code (preview) |
| 3 | +description: Build, discover, try, and consume APIs from your Azure API center using the API Center extension for Visual Studio Code (preview) |
4 | 4 | author: dlepow
|
5 | 5 | ms.service: api-center
|
6 | 6 | ms.topic: how-to
|
7 |
| -ms.date: 01/24/2024 |
| 7 | +ms.date: 03/04/2024 |
8 | 8 | ms.author: danlep
|
9 | 9 | ms.custom:
|
10 |
| -# Customer intent: As a developer, I want to use my Visual Studio Code environment to discover, try, and consume APIs in my organization's API center. |
| 10 | +# Customer intent: As a developer, I want to use my Visual Studio Code environment to build, discover, try, and consume APIs in my organization's API center. |
11 | 11 | ---
|
12 | 12 |
|
13 | 13 | # Get started with the Azure API Center extension for Visual Studio Code (preview)
|
14 | 14 |
|
15 |
| -To discover, try, and consume APIs in your [API center](overview.md), you can use the Azure API Center extension in your Visual Studio Code development environment: |
| 15 | +To build, discover, try, and consume APIs in your [API center](overview.md), you can use the Azure API Center extension in your Visual Studio Code development environment: |
| 16 | + |
| 17 | +* **Build APIs** - Make APIs you're building discoverable to others by registering them in your API center. Shift-left API design conformance checks into Visual Studio Code with integrated linting support, powered by Spectral. |
16 | 18 |
|
17 | 19 | * **Discover APIs** - Browse the APIs in your API center, and view their details and documentation.
|
18 | 20 |
|
@@ -48,16 +50,35 @@ The following Visual Studio Code extensions are optional and needed only for cer
|
48 | 50 | 1. If you're not signed in to your Azure account, select **Sign in to Azure...**, and follow the prompts to sign in.
|
49 | 51 | Select an Azure account with the API center (or API centers) you wish to view APIs from. You can also filter on specific subscriptions if you have many to view from.
|
50 | 52 |
|
| 53 | +## Register APIs |
| 54 | + |
| 55 | +Register an API in your API center directly from Visual Studio Code, either by registering it as a one-time operation or with a CI/CD pipeline. |
| 56 | + |
| 57 | +1. Use the **Ctrl+Shift+P** keyboard shortcut to open the Command Palette. Type **Azure API Center: Register API** and hit **Enter**. |
| 58 | +1. Select how you want to register your API with your API center: |
| 59 | + * **Step-by-step** is best for one-time registration of APIs. |
| 60 | + * **CI/CD** adds a preconfigured GitHub or Azure DevOps pipeline to your active Visual Studio Code workspace that is run as part of a CI/CD workflow on each commit to source control. It's recommended to inventory APIs with your API center using CI/CD to ensure API metadata including specification and version stay current in your API center as the API continues to evolve over time. |
| 61 | +1. Complete registration steps: |
| 62 | + * For **Step-by-step**, select the API center to register APIs with, and answer prompts with information including API title, type, lifecycle stage, version, and specification to complete API registration. |
| 63 | + * For **CI/CD**, select either **GitHub** or **Azure DevOps**, depending on your preferred source control mechanism. A Visual Studio Code workspace must be open for the API Center extension to add a pipeline to your workspace. After the file is added, complete steps documented in the CI/CD pipeline file itself to configure Azure Pipeline/GitHub Action environment variables and identity. On push to source control, the API will be registered in your API center. |
| 64 | + |
| 65 | +## API design conformance |
| 66 | + |
| 67 | +To ensure design conformance with organizational standards as you build APIs, the Azure API Center extension for Visual Studio Code provides integrated support for API specification linting with Spectral. |
| 68 | + |
| 69 | +1. Use the **Ctrl+Shift+P** keyboard shortcut to open the Command Palette. Type **Azure API Center: Set active API Style Guide** and hit **Enter**. |
| 70 | +2. Select one of the default rules provided, or, if your organization has a style guide already available, use **Select Local File** or **Input Remote URL** to specify the active ruleset in Visual Studio Code. Hit **Enter**. |
| 71 | + |
| 72 | +Once an active API style guide is set, opening any OpenAPI or AsyncAPI-based specification file will trigger a local linting operation in Visual Studio Code. Results are displayed both inline in the editor, as well as in the Problems window (**View** > **Problems** or **Ctrl+Shift+M**). |
| 73 | + |
| 74 | +:::image type="content" source="media/use-vscode-extension/local-linting.png" alt-text="Screenshot of local-linting in Visual Studio Code." lightbox="media/use-vscode-extension/local-linting.png"::: |
| 75 | + |
51 | 76 | ## Discover APIs
|
52 | 77 |
|
53 | 78 | Your API center resources appear in the tree view on the left-hand side. Expand an API center resource to see APIs, versions, definitions, environments, and deployments.
|
54 | 79 |
|
55 | 80 | :::image type="content" source="media/use-vscode-extension/explore-api-centers.png" alt-text="Screenshot of API Center tree view in Visual Studio Code." lightbox="media/use-vscode-extension/explore-api-centers.png":::
|
56 | 81 |
|
57 |
| -> [!NOTE] |
58 |
| -> Currently, all APIs and other entities shown in the tree view are read-only. You can't create, update, or delete entities in an API center from the extension. |
59 |
| -
|
60 |
| - |
61 | 82 | ## View API documentation
|
62 | 83 |
|
63 | 84 | You can view the documentation for an API definition in your API center and try API operations. This feature is only available for OpenAPI-based APIs in your API center.
|
@@ -103,8 +124,7 @@ The client is generated.
|
103 | 124 |
|
104 | 125 | For details on using the Kiota extension, see [Microsoft Kiota extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-graph.kiota).
|
105 | 126 |
|
106 |
| - |
107 | 127 | ## Related content
|
108 | 128 |
|
109 | 129 | * [Azure API Center - key concepts](key-concepts.md)
|
110 |
| -* [Discover APIs with GitHub Copilot Chat and Azure API Center extension for Visual Studio Code](use-vscode-extension-copilot.md) |
| 130 | +* [Discover APIs with GitHub Copilot Chat and Azure API Center extension for Visual Studio Code](use-vscode-extension-copilot.md) |
0 commit comments