Azure API Management中用Bicep配置API出站策略时实体未找到
使用Bicep为API操作配置出站策略时遇到实体未找到错误
我在尝试用Bicep文件为API的指定操作配置出站策略时,收到以下验证错误:
"statusMessage": { "status": "Failed", "error": { "code": "ValidationError", "message": "Entity with specified identifier not found" } }
我使用的Bicep代码片段如下:
resource relationApiSym 'Microsoft.ApiManagement/service/apis@2022-08-01' existing = { name: relationsApi.name parent: apiManagementInstance resource operationRegisterId 'operations@2022-08-01' existing = { name : 'post-registerrelation-id' resource policyId 'policies@2022-08-01' = { name: 'policy' properties: { format: 'xml' value:'<policies>\r\n<inbound>\r\n<base />\r\n</inbound>\r\n<backend>\r\n<base />\r\n</backend>\r\n<outbound>\r\n<base />\r\n<choose>\r\n<when condition="@(context.Response.StatusCode == 200)">\r\n<set-body>@{var response = context.Response.Body.As<JObject>();foreach (var key in new [] {"RelatieId"}) {response.Property (key).Remove ();}return response.ToString();}\r\n</set-body>\r\n</when>\r\n</choose>\r\n</outbound>\r\n<on-error>\r\n<base />\r\n</on-error>\r\n</policies>' } } } }
我已确认目标操作名称post-register-relation-id确实存在,但查看部署日志的目标URL时,发现策略并未被创建:

内容的提问来源于stack exchange,提问作者Rob Joosen
相关产品推荐
相关产品推荐

