我可以在Azure资源管理器模板中将文件的内容作为字符串值包括或引用吗?

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

我正在尝试编写模板以将一些示例api部署到API Management中。现在,某些属性值相当冗长而复杂。例如。我有此政策

 {
            "type": "Microsoft.ApiManagement/service/policies",
            "apiVersion": "2019-01-01",
            "name": "[concat(parameters('service_apim_name'), '/policy')]",
            "dependsOn": [
                "[resourceId('Microsoft.ApiManagement/service', parameters('service_simon_hm_name'))]"
            ],
            "properties": {
                "value": "<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound></inbound>\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound></outbound>\r\n</policies>",
                "format": "xml"
            }
        }

如何将策略值分解为XML文件?

azure azure-resource-manager
1个回答
0
投票

[您今天无法执行此操作...您可以通过将值放入KeyVault并从中拉出来进行近似,但是今天平台上没有#include类型的行为。

有些人在客户端上进行自己的预处理...

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