Skip to content

Commit 4930aa2

Browse files
Merge pull request #273891 from dlepow/gacli
[APIC][release-ga-api-center] Update CLI commands
2 parents 1e320e7 + 8cb82a8 commit 4930aa2

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

articles/api-center/import-api-management-apis.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Add APIs to your Azure API center inventory from your API Managemen
44
author: dlepow
55
ms.service: api-center
66
ms.topic: how-to
7-
ms.date: 03/08/2024
7+
ms.date: 04/30/2024
88
ms.author: danlep
99
ms.custom: devx-track-azurecli
1010
# Customer intent: As an API program manager, I want to add APIs that are managed in my Azure API Management instance to my API center.
@@ -57,14 +57,14 @@ The following example command exports the API with identifier *my-api* in the *m
5757
#! /bin/bash
5858
az apim api export --api-id my-api --resource-group myResourceGroup \
5959
--service-name myAPIManagement --export-format OpenApiJsonFile \
60-
--file-path /path/to/folder
60+
--file-path "/path/to/folder"
6161
```
6262

6363
```azurecli
6464
#! PowerShell syntax
6565
az apim api export --api-id my-api --resource-group myResourceGroup `
6666
--service-name myAPIManagement --export-format OpenApiJsonFile `
67-
--file-path /path/to/folder
67+
--file-path '/path/to/folder'
6868
```
6969
### Export API to a URL
7070

@@ -91,7 +91,7 @@ You can register a new API in your API center from the exported definition by us
9191
The following example registers an API in the *myAPICenter* API center from a local OpenAPI definition file named *definitionFile.json*.
9292

9393
```azurecli
94-
az apic api register --resource-group myResourceGroup --service myAPICenter --api-location "/path/to/definitionFile.json
94+
az apic api register --resource-group myResourceGroup --service myAPICenter --api-location "/path/to/definitionFile.json"
9595
```
9696

9797
### Import API definition to an existing API in your API center
@@ -104,17 +104,17 @@ This example assumes you have an API named *my-api* and an associated API versio
104104
#! /bin/bash
105105
az apic api definition import-specification \
106106
--resource-group myResourceGroup --service myAPICenter \
107-
--api-name my-api --version-name v1-0-0 \
108-
--definition-name openapi --format "link" --value '$link' \
107+
--api-id my-api --version-id v1-0-0 \
108+
--definition-id openapi --format "link" --value '$link' \
109109
--specification '{"name":"openapi","version":"3.0.2"}'
110110
```
111111

112112
```azurecli
113113
# PowerShell syntax
114114
az apic api definition import-specification `
115115
--resource-group myResourceGroup --service myAPICenter `
116-
--api-name my-api --version-name v1-0-0 `
117-
--definition-name openapi --format "link" --value '$link' `
116+
--api-id my-api --version-id v1-0-0 `
117+
--definition-id openapi --format "link" --value '$link' `
118118
--specification '{"name":"openapi","version":"3.0.2"}'
119119
```
120120

@@ -131,7 +131,7 @@ When you add APIs from an API Management instance to your API center using `az a
131131

132132
### Add a managed identity in your API center
133133

134-
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access APIs in your API Management instance. You can use either a system-assigned or user-assigned managed identity. If you haven't added a managed identity in your API center, you can add it in the Azure portal or by using the Azure CLI.
134+
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access APIs in your API Management instance. Depending on your needs, use either a system-assigned or user-assigned managed identity. If you haven't added a managed identity in your API center, you can add it in the Azure portal or by using the Azure CLI.
135135

136136
#### Add a system-assigned identity
137137

articles/api-center/manage-apis-azure-cli.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: dlepow
55
ms.service: api-center
66
ms.custom: devx-track-azurecli
77
ms.topic: how-to
8-
ms.date: 01/12/2024
8+
ms.date: 04/30/2024
99
ms.author: danlep
1010
# Customer intent: As an API program manager, I want to automate processes to register and update APIs in my Azure API center.
1111
---
@@ -38,12 +38,10 @@ The following example creates an API named *Petstore API* in the *myResourceGrou
3838

3939
```azurecli-interactive
4040
az apic api create --resource-group myResourceGroup \
41-
--service myAPICenter --name petstore-api \
42-
--title "Petstore API" --kind "rest"
41+
--service myAPICenter --api-id petstore-api \
42+
--title "Petstore API" --type "rest"
4343
```
4444

45-
By default, the command sets the API's **Lifecycle stage** to *design*.
46-
4745
> [!NOTE]
4846
> 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.
4947
@@ -52,12 +50,12 @@ By default, the command sets the API's **Lifecycle stage** to *design*.
5250

5351
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.
5452

55-
The following example creates an API version named *v1-0-0* for the *petstore-api* API that you created in the previous section.
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.
5654

5755
```azurecli-interactive
5856
az apic api version create --resource-group myResourceGroup \
59-
--service myAPICenter --api-name petstore-api \
60-
--version v1-0-0 --title "v1-0-0"
57+
--service myAPICenter --api-id petstore-api \
58+
--version-id v1-0-0 --title "v1-0-0" --lifecycle-stage "testing"
6159
```
6260

6361
### Create API definition and add specification file
@@ -70,8 +68,8 @@ The following example uses the [az apic api definition create](/cli/azure/apic/a
7068

7169
```azurecli-interactive
7270
az apic api definition create --resource-group myResourceGroup \
73-
--service myAPICenter --api-name petstore-api \
74-
--version v1-0-0 --name "openapi" --title "OpenAPI"
71+
--service myAPICenter --api-id petstore-api \
72+
--version-id v1-0-0 --definition-id openapi --title "OpenAPI"
7573
```
7674

7775
#### Import a specification file
@@ -84,8 +82,8 @@ The following example imports an OpenAPI specification file from a publicly acce
8482
```azurecli-interactive
8583
az apic api definition import-specification \
8684
--resource-group myResourceGroup --service myAPICenter \
87-
--api-name petstore-api --version-name v1-0-0 \
88-
--definition-name openapi --format "link" \
85+
--api-id petstore-api --version-id v1-0-0 \
86+
--definition-id openapi --format "link" \
8987
--value 'https://petstore3.swagger.io/api/v3/openapi.json' \
9088
--specification '{"name":"openapi","version":"3.0.2"}'
9189
```
@@ -102,8 +100,8 @@ The following example exports the specification file from the *openapi* definiti
102100
```azurecli-interactive
103101
az apic api definition export-specification \
104102
--resource-group myResourceGroup --service myAPICenter \
105-
--api-name petstore-api --version-name v1-0-0 \
106-
--definition-name openapi --file-name "/Path/to/specificationFile.json"
103+
--api-id petstore-api --version-id v1-0-0 \
104+
--definition-id openapi --file-name "/Path/to/specificationFile.json"
107105
```
108106

109107
## Register API from a specification file - single step
@@ -131,13 +129,13 @@ Use the [az apic api delete](/cli/azure/apic/api#az_apic_api_delete) command to
131129
```azurecli-interactive
132130
az apic api delete \
133131
--resource-group myResoureGroup --service myAPICenter \
134-
--name petstore-api
132+
--api-id petstore-api
135133
```
136134

137135
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.
138136

139137
## Related content
140138

141-
* 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-schema), and [services](/cli/azure/apic/service).
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).
142140
* [Import APIs to your API center from API Management](import-api-management-apis.md)
143141
* [Use the Visual Studio extension for API Center](use-vscode-extension.md) to build and register APIs from Visual Studio Code.

0 commit comments

Comments
 (0)