如何获取 Azure APIM 中操作策略的详细信息

问题描述 投票:0回答:1

有没有办法过滤并获取 APIM 中操作的所有策略。

我正在 AZ CLI 中传递此行:

az apim api operation show --resource-group $myResourceGroup --api-id $apiId --service-name $serviceName --operation-id $operationId

但是对于策略字段,我得到 null 作为输出。

policies: null

我还测试了az apim api操作列表,但我仍然没有得到预期的输出。

azure-api-management azure-cli
1个回答
0
投票

您可以使用以下 CLI 命令检索

operation ID
详细信息。

az apim api operation show --api-id mynew --operation-id new -g xxx -n policyj

enter image description here

完成后,您需要使用

az rest --method
CLI 命令和
Get
方法来检索 API 的策略详细信息,如下所示。

az rest --method get --uri "/subscriptions/xxxx/resourceGroups/xxx/providers/Microsoft.ApiManagement/service/<APIM>/apis/<APIName>/operations/new/policies?api-version=2020-06-01-preview"

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.