【发布时间】:2018-10-29 03:28:53
【问题描述】:
在策略重写期间简单附加到上下文变量(例如 context.Variables["accountKey"])的 url 的方法是什么?
最终结果应该是/accounts/232。
我之前设置成功了
set-variable (0.003 ms)
{
"message": "Context variable was successfully set.",
"name": "accountKey",
"value": "232"
}
尝试过的事情之一:
<policies>
<inbound>
<base />
<rewrite-uri template="/accounts/{accountKey}" />
</inbound>
但我得到了这个错误
> Error Receive
> rewrite-uri (0.260 ms) {
> "messages": [
> null,
> "Variable accountKey has no value.",
> "Variable accountKey has no value."
> ] }
【问题讨论】:
标签: azure url-rewriting policy azure-api-management