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
> `az apic` commands require the `apic-extension` Azure CLI extension. If you haven't used `az apic` commands, the extension is installed dynamically when you run your first `az apic` command. Learn more about [Azure CLI extensions](/cli/azure/azure-cli-extensions-overview).
> Azure CLI command examples in this article can run in PowerShell or a bash shell. Where needed because of different variable syntax, separate command examples are provided for the two shells.
> `az apic` commands require the `apic-extension` Azure CLI extension. If you haven't used `az apic` commands, the extension is installed dynamically when you run your first `az apic` command. Learn more about [Azure CLI extensions](/cli/azure/azure-cli-extensions-overview).
> Azure CLI command examples in this article can run in PowerShell or a bash shell. Where needed because of different variable syntax, separate command examples are provided for the two shells.
> `az apic` commands require the `apic-extension` Azure CLI extension. If you haven't used `az apic` commands, the extension can be installed dynamically when you run your first `az apic` command, or you can install the extension manually. Learn more about [Azure CLI extensions](/cli/azure/azure-cli-extensions-overview).g
Copy file name to clipboardExpand all lines: articles/api-center/manage-apis-azure-cli.md
+20-22Lines changed: 20 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,8 @@ title: Manage API inventory in Azure API Center - Azure CLI
3
3
description: Use the Azure CLI to create and update APIs, API versions, and API definitions in your Azure API center.
4
4
author: dlepow
5
5
ms.service: api-center
6
-
ms.custom: devx-track-azurecli
7
6
ms.topic: how-to
8
-
ms.date: 04/30/2024
7
+
ms.date: 01/12/2024
9
8
ms.author: danlep
10
9
# Customer intent: As an API program manager, I want to automate processes to register and update APIs in my Azure API center.
11
10
---
@@ -14,21 +13,20 @@ ms.author: danlep
14
13
15
14
This article shows how to use [`az apic api`](/cli/azure/apic/api) commands in the Azure CLI to add and configure APIs in your [API center](overview.md) inventory. Use commands in the Azure CLI to script operations to manage your API inventory and other aspects of your API center.
> `az apic` commands require the `apic-extension` Azure CLI extension. If you haven't used `az apic` commands, the extension is installed dynamically when you run your first `az apic` command. Learn more about [Azure CLI extensions](/cli/azure/azure-cli-extensions-overview).
The following steps show how to create an API and associate a single API version and API definition. For background about the data model in Azure API Center, see [Key concepts](key-concepts.md).
29
+
The following steps show how to create an API and associate a single API version and API definition. For background about the data model in API Center, see [Key concepts](key-concepts.md).
32
30
33
31
### Create an API
34
32
@@ -38,10 +36,12 @@ The following example creates an API named *Petstore API* in the *myResourceGrou
38
36
39
37
```azurecli-interactive
40
38
az apic api create --resource-group myResourceGroup \
41
-
--service myAPICenter --api-id petstore-api \
42
-
--title "Petstore API" --type "rest"
39
+
--service myAPICenter --name petstore-api \
40
+
--title "Petstore API" --kind "rest"
43
41
```
44
42
43
+
By default, the command sets the API's **Lifecycle stage** to *design*.
44
+
45
45
> [!NOTE]
46
46
> After creating an API, you can update the API's properties by using the [az apic api update](/cli/azure/apic/api#az_apic_api_update) command.
47
47
@@ -50,12 +50,12 @@ az apic api create --resource-group myResourceGroup \
50
50
51
51
Use the [az apic api version create](/cli/azure/apic/api/version#az_apic_api_version_create) command to create a version for your API.
52
52
53
-
The following example creates an API version named *v1-0-0* for the *petstore-api* API that you created in the previous section. The version is set to the *testing* lifecycle stage.
53
+
The following example creates an API version named *v1-0-0* for the *petstore-api* API that you created in the previous section.
54
54
55
55
```azurecli-interactive
56
56
az apic api version create --resource-group myResourceGroup \
To delete individual API versions and definitions, use [az apic api version delete](/cli/azure/apic/api/version#az-apic-api-version-delete) and [az apic api definition delete](/cli/azure/apic/api/definition#az-apic-api-definition-delete), respectively.
136
136
137
137
## Related content
138
138
139
-
* See the [Azure CLI reference for Azure API Center](/cli/azure/apic) for a complete command list, including commands to manage [environments](/cli/azure/apic/environment), [deployments](/cli/azure/apic/api/deployment), [metadata schemas](/cli/azure/apic/metadata), and [services](/cli/azure/apic/service).
140
-
*[Import APIs to your API center from API Management](import-api-management-apis.md)
141
-
*[Use the Visual Studio extension for API Center](use-vscode-extension.md) to build and register APIs from Visual Studio Code.
139
+
See the [Azure CLI reference for API Center](/cli/azure/apic) for a complete command list, including commands to manage [environments](/cli/azure/apic/environment), [deployments](/cli/azure/apic/api/deployment), [metadata schemas](/cli/azure/apic/metadata-schema), and [API Center services](/cli/azure/apic/service).
> `az apic` commands require the `apic-extension` Azure CLI extension. If you haven't used `az apic` commands, the extension is installed dynamically when you run your first `az apic` command. Learn more about [Azure CLI extensions](/cli/azure/azure-cli-extensions-overview).
0 commit comments