你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

参考:视图定义项目

本文是 Azure 托管应用程序中 viewDefinition.json 项目的参考。 有关创作视图配置的详细信息,请参阅视图定义项目

查看定义

以下 JSON 演示了 Azure 托管应用程序的 viewDefinition.json 文件的示例:

{
  "views": [
    {
      "kind": "Overview",
      "properties": {
        "header": "Welcome to your Demo Azure Managed Application",
        "description": "This Managed application with Custom Provider is for demo purposes only.",
        "commands": [
          {
            "displayName": "Ping Action",
            "path": "/customping",
            "icon": "LaunchCurrent"
          }
        ]
      }
    },
    {
      "kind": "CustomResources",
      "properties": {
        "displayName": "Users",
        "version": "1.0.0.0",
        "resourceType": "users",
        "createUIDefinition": {
          "parameters": {
            "steps": [
              {
                "name": "add",
                "label": "Add user",
                "elements": [
                  {
                    "name": "name",
                    "label": "User's Full Name",
                    "type": "Microsoft.Common.TextBox",
                    "defaultValue": "",
                    "toolTip": "Provide a full user name.",
                    "constraints": {
                      "required": true
                    }
                  },
                  {
                    "name": "location",
                    "label": "User's Location",
                    "type": "Microsoft.Common.TextBox",
                    "defaultValue": "",
                    "toolTip": "Provide a Location.",
                    "constraints": {
                      "required": true
                    }
                  }
                ]
              }
            ],
            "outputs": {
              "name": "[steps('add').name]",
              "properties": {
                "FullName": "[steps('add').name]",
                "Location": "[steps('add').location]"
              }
            }
          }
        },
        "commands": [
          {
            "displayName": "Custom Context Action",
            "path": "users/contextAction",
            "icon": "Start"
          }
        ],
        "columns": [
          {
            "key": "properties.FullName",
            "displayName": "Full Name"
          },
          {
            "key": "properties.Location",
            "displayName": "Location",
            "optional": true
          }
        ]
      }
    }
  ]
}

后续步骤