You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure APIM策略:从NameValue渲染托管标识资源值的问题与解决

Azure APIM托管标识Resource值渲染问题解决

问题说明

通过Terraform部署Azure APIM策略时,需从NameValue中读取对应值作为<authentication-managed-identity>的resource参数,先后尝试两种写法均未达到预期效果:

  • 写法1:<authentication-managed-identity resource="{{CRM-EWR-Resource-Client-Id}}" />,部署后原字符串未被替换,仍保留{{CRM-EWR-Resource-Client-Id}}
  • 写法2:<authentication-managed-identity resource="CRM-EWR-Resource-Client-Id" />,部署后未渲染出目标值de08357d-b6c-454-wew-21321sd

可行方案

通过先将NameValue中的值存入变量,再使用表达式引用变量的方式成功实现值的渲染:

<set-variable name="test" value="{{CRM-EWR-Resource-Client-Id_dev}}" />
<authentication-managed-identity resource="@(context.Variables["test"] as string)" />

内容的提问来源于stack exchange,提问作者Ali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 17:09:50