你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az apic service

注意

此参考是 Azure CLI(版本 2.57.0 或更高版本)的 apic-extension 扩展的一部分。 该扩展将在首次运行 az apic service 命令时自动安装。 详细了解扩展。

管理 Azure API 中心服务实例。

命令

名称 说明 类型 状态
az apic service create

创建实例或更新 Azure API 中心服务的现有实例。

扩展 GA
az apic service delete

删除 Azure API 中心服务的实例。

扩展 GA
az apic service import-from-apim

从 Azure API 管理服务实例导入 API。

扩展 GA
az apic service list

列出 Azure 订阅中的 Azure API 中心服务。

扩展 GA
az apic service show

显示 Azure API 中心服务实例的详细信息。

扩展 GA
az apic service update

更新 Azure API 中心服务的实例。

扩展 GA

az apic service create

创建实例或更新 Azure API 中心服务的现有实例。

az apic service create --name
                       --resource-group
                       [--identity]
                       [--location]
                       [--tags]

示例

创建服务示例 1

az apic service create -g contoso-resources -s contoso -l eastus

创建服务示例 2

az apic service create --resource-group contoso-resources --name contoso --location eastus

必需参数

--name --service --service-name -s

API 中心服务的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

可选参数

--identity

分配给此资源的托管服务标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--location -l

未指定资源所在的地理位置,将使用资源组的位置。

--tags

资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az apic service delete

删除 Azure API 中心服务的实例。

az apic service delete [--ids]
                       [--name]
                       [--resource-group]
                       [--subscription]
                       [--yes]

示例

删除服务

az apic service delete -s contoso -g contoso-resources

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name --service --service-name -s

API 中心服务的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--yes -y

不提示确认。

默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az apic service import-from-apim

从 Azure API 管理服务实例导入 API。

az apic service import-from-apim --source-resource-ids
                                 [--ids]
                                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                 [--resource-group]
                                 [--service]
                                 [--subscription]

示例

从 APIM 导入

az apic service import-from-apim -g api-center-test --service-name contosoeuap --source-resource-ids '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/servicegroup/providers/Microsoft.ApiManagement/service/contoso/apis/contosoapi'

必需参数

--source-resource-ids

支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--no-wait

不等待长时间运行的操作完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--service --service-name -s

Azure API 中心服务的名称。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az apic service list

列出 Azure 订阅中的 Azure API 中心服务。

az apic service list [--max-items]
                     [--next-token]
                     [--resource-group]

示例

列出资源组中的服务

az apic service list -g contoso-resources

可选参数

--max-items

命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的参数中 --next-token 提供令牌值。

--next-token

用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az apic service show

显示 Azure API 中心服务实例的详细信息。

az apic service show [--ids]
                     [--name]
                     [--resource-group]
                     [--subscription]

示例

显示服务详细信息

az apic service show -g contoso-resources -s contoso

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name --service --service-name -s

API 中心服务的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az apic service update

更新 Azure API 中心服务的实例。

az apic service update [--identity]
                       [--ids]
                       [--name]
                       [--resource-group]
                       [--subscription]
                       [--tags]

示例

更新服务详细信息

az apic service update -g contoso-resources -s contoso

可选参数

--identity

分配给此资源的托管服务标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name --service --service-name -s

Azure API 中心服务的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--tags

资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。