json 无法分析模板语言表达式

kdfy810k  于 2023-11-20  发布在  其他
关注(0)|答案(1)|浏览(110)

我是一个Azure架构师,而不是一个开发人员,所以请慢慢分解:)
我试图部署在逻辑应用程序设计过程中生成的以下http代码体。Http主体是自动生成的,应该复制/粘贴到下一个函数中。但是,当将其粘贴到下一步时,我现在得到这个错误:

1一个善良的灵魂,请解释如何确定列1257?(我使用记事本++试图找出列,但无济于事)#2它可能需要一个天才在这个网站上认识到语法问题在2秒.

错误代码:无法保存逻辑应用程序allen-keyvaultsecrets。模板验证失败:"行“1”和列“1257”处的模板操作“Parse_JSON”无效:“无法分析模板语言表达式”odata. context“:预期标记”LeftParenthesis“和实际”Dot“。”
HTTP代码:

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications(id,appId,displayName,passwordCredentials)",
  "value": [
    {
      "id": "03e0fe1b-06c1-",
      "appId": "8d66a6f6-",
      "displayName": "SharePoint Online Client Extensibility Web Application Principal",
      "passwordCredentials": [
        {
          "customKeyIdentifier": "kyy",
          "displayName": null,
          "endDateTime": "2072-02-15T09:18:56.9091524Z",
          "hint": null,
          "keyId": "ba098647-6233-4011-860c-caef05bf3045",
          "secretText": null,
          "startDateTime": "2022-02-15T09:18:56.9091524Z"
        }
      ]
    },
    {
      "id": "0724ef3d-",
      "appId": "a0559740-",
      "displayName": "Translator",
      "passwordCredentials": []
    },
    {
      "id": "08aa1479-",
      "appId": "d1a7f126-",
      "displayName": "Fortigate-disk-",
      "passwordCredentials": [
        {
          "customKeyIdentifier": null,
          "displayName": null,
          "endDateTime": "2024-04-24T17:33:11.9693126Z",
          "hint": "Uxa",
          "keyId": "9c79dec8-c670-41a5-a8b7-847f059f5886",
          "secretText": null,
          "startDateTime": "2023-04-24T17:33:11.9693126Z"
        }
      ]
    },
    {
      "id": "0bdf42ba-",
      "appId": "472a9348-",
      "displayName": "",
      "passwordCredentials": [
        {
          "customKeyIdentifier": null,
          "displayName": null,
          "endDateTime": "2024-04-04T06:57:20.5901826Z",
          "hint": "rKG",
          "keyId": "73afa852-881b-4ded-a9ef-9f4633b5ab9f",
          "secretText": null,
          "startDateTime": "2023-04-04T06:57:20.5901826Z"
        }
      ]
    },
    {
      "id": "0d0fe2a0-",
      "appId": "391fc1c7-",
      "displayName": "azure-cli-2020-06-11-01-30-16",
      "passwordCredentials": [
        {
          "customKeyIdentifier": "//5",
          "displayName": null,
          "endDateTime": "2021-06-11T01:30:16.25462Z",
          "hint": null,
          "keyId": "cef243ab-a0fa-495f-811d-5a5d4d73b6e7",
          "secretText": null,
          "startDateTime": "2020-06-11T01:30:16.25462Z"
        }
      ]
    },

字符串
我不知道该怎么做编辑,所以我不知道如何找到列1257

axr492tv

axr492tv1#

无法保存逻辑应用程序allen-keyvaultsecrets。模板验证失败:"行“1”和列“1257”处的模板操作“Parse_JSON”无效:“无法分析模板语言表达式”odata. context“:预期标记”LeftParenthesis“和实际”Dot“。”
通过查看错误消息,我相信您正在逻辑应用程序中使用Parse_JSON
Http主体是自动生成的,应该复制/粘贴到下一个函数中。但是当粘贴到下一步时,我现在得到这个错误。
对于Parse_JSON,您需要定义输入数据的模式,如下所示-
x1c 0d1x的数据
添加来自上一个操作的数据。



请确保您已正确添加了Json payload,包括所有的右括号。

我的工作流程如下-

  • 验证码 *-
{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Data": {
                "inputs": {
                    "variables": [
                        {
                            "name": "Data",
                            "type": "string",
                            "value": "{\n  \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#applications(id,appId,displayName,passwordCredentials)\",\n  \"value\": [\n    {\n      \"id\": \"03e0fe1b-06c1-\",\n      \"appId\": \"8d66a6f6-\",\n      \"displayName\": \"SharePoint Online Client Extensibility Web Application Principal\",\n      \"passwordCredentials\": [\n        {\n          \"customKeyIdentifier\": \"kyy\",\n          \"displayName\": null,\n          \"endDateTime\": \"2072-02-15T09:18:56.9091524Z\",\n          \"hint\": null,\n          \"keyId\": \"ba098647-6233-4011-860c-caef05bf3045\",\n          \"secretText\": null,\n          \"startDateTime\": \"2022-02-15T09:18:56.9091524Z\"\n        }\n      ]\n    },\n    {\n      \"id\": \"0724ef3d-\",\n      \"appId\": \"a0559740-\",\n      \"displayName\": \"Translator\",\n      \"passwordCredentials\": []\n    },\n    {\n      \"id\": \"08aa1479-\",\n      \"appId\": \"d1a7f126-\",\n      \"displayName\": \"Fortigate-disk-\",\n      \"passwordCredentials\": [\n        {\n          \"customKeyIdentifier\": \"null\",\n          \"displayName\": null,\n          \"endDateTime\": \"2024-04-24T17:33:11.9693126Z\",\n          \"hint\": \"Uxa\",\n          \"keyId\": \"9c79dec8-c670-41a5-a8b7-847f059f5886\",\n          \"secretText\": null,\n          \"startDateTime\": \"2023-04-24T17:33:11.9693126Z\"\n        }\n      ]\n    },\n    {\n      \"id\": \"0bdf42ba-\",\n      \"appId\": \"472a9348-\",\n      \"displayName\": \"\",\n      \"passwordCredentials\": [\n        {\n          \"customKeyIdentifier\": \"null\",\n          \"displayName\": null,\n          \"endDateTime\": \"2024-04-04T06:57:20.5901826Z\",\n          \"hint\": \"rKG\",\n          \"keyId\": \"73afa852-881b-4ded-a9ef-9f4633b5ab9f\",\n          \"secretText\": null,\n          \"startDateTime\": \"2023-04-04T06:57:20.5901826Z\"\n        }\n      ]\n    },\n    {\n      \"id\": \"0d0fe2a0-\",\n      \"appId\": \"391fc1c7-\",\n      \"displayName\": \"azure-cli-2020-06-11-01-30-16\",\n      \"passwordCredentials\": [\n        {\n          \"customKeyIdentifier\": \"//5\",\n          \"displayName\": null,\n          \"endDateTime\": \"2021-06-11T01:30:16.25462Z\",\n          \"hint\": null,\n          \"keyId\": \"cef243ab-a0fa-495f-811d-5a5d4d73b6e7\",\n          \"secretText\": null,\n          \"startDateTime\": \"2020-06-11T01:30:16.25462Z\"\n        }\n      ]\n    }\n ]\n}"
                        }
                    ]
                },
                "runAfter": {},
                "type": "InitializeVariable"
            },
            "Parse_JSON": {
                "inputs": {
                    "content": "@variables('Data')",
                    "schema": {
                        "properties": {
                            "@@odata.context": {
                                "type": "string"
                            },
                            "value": {
                                "items": {
                                    "properties": {
                                        "appId": {
                                            "type": "string"
                                        },
                                        "displayName": {
                                            "type": "string"
                                        },
                                        "id": {
                                            "type": "string"
                                        },
                                        "passwordCredentials": {
                                            "items": {
                                                "properties": {
                                                    "customKeyIdentifier": {
                                                        "type": "string"
                                                    },
                                                    "displayName": {},
                                                    "endDateTime": {
                                                        "type": "string"
                                                    },
                                                    "hint": {},
                                                    "keyId": {
                                                        "type": "string"
                                                    },
                                                    "secretText": {},
                                                    "startDateTime": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "customKeyIdentifier",
                                                    "displayName",
                                                    "endDateTime",
                                                    "hint",
                                                    "keyId",
                                                    "secretText",
                                                    "startDateTime"
                                                ],
                                                "type": "object"
                                            },
                                            "type": "array"
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "appId",
                                        "displayName",
                                        "passwordCredentials"
                                    ],
                                    "type": "object"
                                },
                                "type": "array"
                            }
                        },
                        "type": "object"
                    }
                },
                "runAfter": {
                    "Data": [
                        "Succeeded"
                    ]
                },
                "type": "ParseJson"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {},
        "triggers": {
            "manual": {
                "inputs": {},
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {}
}

字符串

  • 获得成功的结果 *-

请试着这样做,你也会得到结果的。

相关问题