【问题标题】:ARM template output gets percent-escapedARM 模板输出得到百分比转义
【发布时间】:2021-01-30 06:46:06
【问题描述】:

最近我们的 ARM 模板部署失败了,因为输出得到了百分比转义。

我们需要 Logic App url 作为其 ARM 模板的输出,并将其输出为:

"outputs": {
    "url": {
      "type": "object",
      "value": {
        "key": "[concat(variables('LogicAppShortName'),'-url')]",
        "value": "[listCallbackUrl(concat(resourceId('Microsoft.Logic/workflows/', variables('LogicAppName')), '/triggers/manual'), '2016-06-01').value]"
      }
    }
  }

ARM 模板输出在几天/几周前正常工作并导致

...?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=...

但现在结果是

...?api-version=2016-06-01&sp=%252Ftriggers%252Fmanual%252Frun&sv=1.0&sig=...

因此 %2F 再次转义并变为 %252F,使 URL 无效。

此外,ARM 部署显示更多日志行,以前只是

Updated output variable 'ArmOutputs', which contains the outputs
section of the current deployment object in string format.

现在是 4 行,表明发生了一些变化:

Updated output variable 'ArmOutputs.url.type', which contains the outputs section of the current deployment object in string format. 
Updated output variable 'ArmOutputs.url.value.key', which contains he outputs section of the current deployment object in string format. 
Updated output variable 'ArmOutputs.url.value.value', which contains the outputs section of the current deployment object in string format. 
Updated output variable 'ArmOutputs', which contains the outputs section of the current deployment object in string format.

有人知道如何修复这个错误/“功能”吗?

【问题讨论】:

    标签: azure-resource-manager


    【解决方案1】:

    我遇到了同样的问题,并通过将新的管道变量 DECODE_PERCENTS 设置为 true 来修复它。

    【讨论】:

    • 这工作了一段时间,但不幸的是不再有效。我们决定自己制定一个解决方法,并在适当的位置进行 RegEx 搜索和替换。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-21
    • 1970-01-01
    • 2013-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多