App Layering

入门模板

本节包含一整套可用于 Azure 部署连接器的 ARM 模板。这些模板可以按原样使用,也可以对其进行修改以满足特定需求。

这些模板创建的每个资源都使用相同的标签集进行标记。这些标签包含有关部署上下文的有用信息,例如启动任务的用户的姓名和他们输入的评论。

这些模板在 连接器配置中广泛使用了自定义数据。自定义数据允许用户定义常用参数,例如 locationvmSizegeneration 和其他参数,而无需修改模板。

下表列出了这些模板使用的所有自定义数据属性。它指定了哪些模板适用于每个属性以及该属性是否为必填属性。

R = 必填项,O = 可选,-= 未使用

名称 说明 默认 缓存磁盘 引导映像 计算机 分层映像
location 创建资源的区域。 与目标资源组相同的区域。 O O O O
要在其中创建图像的计算库的名称。库必须位于目标资源组中。 - - R - R
storageSku 用于托管磁盘的 SKU 的名称。 StandardSSD_LRS O - O -
generation 虚拟机的生成。 V2 - O O O
值得信赖的启动 true 否则启用 “可信启动false”。 对于所有部署类型,该值必须相同。 false O O O O
diskAccessId 上传磁盘内容时使用的磁盘访问权限的资源 ID。如果指定了此选项,则在禁用公共网络访问权限的情况下创建磁盘。有关更多信息,请参阅 Azure 文档 null O - - -
vmSize 要创建的 VM 的大小。 标准_D2S_v3 - - O -
licenseType 适用于已创建虚拟机的本地许可证类型。 null - - O -
subnetId 连接虚拟机网卡的子网的资源 ID。 - - - R -
副本计数 图库图像版本每个区域的默认副本数 1 - - - O
目标区域 图库图像版本的目标区域。它被指定为区域名称字符串和/或 TargetRegion 对象的数组。该阵列必须包含源磁盘的区域(由 自定义location数据指定)。 自定义数据指定的location区域 - - - O
publish 发布图像的资源类型。指定为由 “GalleryImage” 和/或 “ManagedDisk” 组成的数组或字符串 画廊图片 - - - O

自定义数据示例:

{
    "gallery": "MyGallery",
    "subnetId": "/subscriptions/ab3d1259-f5a9-407f-bbdd-bfd5701e2e94/resourceGroups/PDGTPB/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/mysubnet"
}
<!--NeedCopy-->

自定义数据的另一个示例:

{
    "location": "eastus",
    "gallery": "MyGallery",
    "storageSku": "Premium_LRS",
    "generation": "V1",
    "diskAccessId": "/subscriptions/ab3d1259-f5a9-407f-bbdd-bfd5701e2e94/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/diskAccesses/MyDiskAccess",
    "vmSize": "Standard_D4s_v3",
    "subnetId": "/subscriptions/ab3d1259-f5a9-407f-bbdd-bfd5701e2e94/resourceGroups/MyResourceGroup/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/mysubnet"
}
<!--NeedCopy-->

缓存磁盘

创建托管磁盘。

缓存磁盘自定义数据

名称 说明 默认 必需
location 创建资源的区域。 与目标资源组相同的区域
storageSku 要使用的 SKU 的名称。 StandardSSD_LRS
值得信赖的启动 true 否则启用 “可信启动false”。 对于所有部署类型,该值必须相同。 false
diskAccessId 上传磁盘内容时使用的磁盘访问权限的资源 ID。如果指定,则在禁用公共网络访问的情况下创建磁盘。 null

缓存磁盘模板

  • 1.1.0.0-增加了对可信启动的支持
  • 1.0.0.0-初始版本
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.1.0.0",
    "parameters": {
        "al": {
            "type": "object"
        }
    },
    "variables": {
        "custom": "[parameters('al').context.config.custom]",
        "location": "[if(contains(variables('custom'), 'location'), variables('custom').location, resourceGroup().location)]",
        "name": "[concat(parameters('al').context.item.name,'-', parameters('al').context.item.id)]",
        "tags": {
            "alTaskId": "[parameters('al').context.taskId]",
            "alUser": "[parameters('al').context.user]",
            "alComment": "[parameters('al').context.comment]",
            "alItemType": "[parameters('al').context.item.type]",
            "alItemId": "[parameters('al').context.item.id]",
            "alItemName": "[parameters('al').context.item.name]",
            "alItemVersion": "[parameters('al').context.item.version.name]",
            "alConfigId": "[parameters('al').context.config.id]",
            "alConfigName": "[parameters('al').context.config.name]"
        },
        "hasDiskAccess": "[contains(variables('custom'), 'diskAccessId')]",
        "storageSku": "[if(contains(variables('custom'), 'storageSku'), variables('custom').storageSku, 'StandardSSD_LRS')]",
        "trustedLaunch": "[if(contains(variables('custom'), 'trustedLaunch'), variables('custom').trustedLaunch, false())]"
    },
    "resources": [
        {
            "type": "Microsoft.Compute/disks",
            "apiVersion": "2021-08-01",
            "name": "[variables('name')]",
            "location": "[variables('location')]",
            "tags": "[variables('tags')]",
            "sku": {
                "name": "[variables('storageSku')]"
            },
            "properties": {
                "creationData": {
                    "createOption": "Upload",
                    "uploadSizeBytes": "[parameters('al').input.uploadSize]"
                },
                "incremental": "false",
                "diskAccessId": "[if(variables('hasDiskAccess'), variables('custom').diskAccessId, null())]",
                "networkAccessPolicy": "[if(variables('hasDiskAccess'), 'AllowPrivate', 'AllowAll')]",
                "publicNetworkAccess": "[if(variables('hasDiskAccess'), 'Disabled', 'Enabled')]",
                "securityProfile": "[if(variables('trustedLaunch'), createObject('securityType', 'TrustedLaunch'), null())]"
            }
        }
    ]
}
<!--NeedCopy-->

引导映像

Boot Image 部署在自定义数据指定的库中创建图库映像和图像版本。它输出创建的计算库图像版本的 ID,供计算机模板使用。

引导映像自定义数据

名称 说明 默认 必需
location 创建资源的区域。 与目标资源组相同的区域。
generation 磁盘中使用的虚拟机的生成。 V2
值得信赖的启动 true 否则启用 “可信启动false”。 对于所有部署类型,该值必须相同。 false
用于在其中创建映像的计算库的名称。库必须位于目标资源组中。 -

启动映像模板

  • 1.1.0.0-增加了对可信启动的支持
  • 1.0.0.0-初始版本
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.1.0.0",
    "parameters": {
        "al": {
            "type": "object"
        }
    },
    "variables": {
        "custom": "[parameters('al').context.config.custom]",
        "location": "[if(contains(variables('custom'), 'location'), variables('custom').location, resourceGroup().location)]",
        "tags": {
            "alTaskId": "[parameters('al').context.taskId]",
            "alUser": "[parameters('al').context.user]",
            "alComment": "[parameters('al').context.comment]",
            "alItemType": "[parameters('al').context.item.type]",
            "alItemId": "[parameters('al').context.item.id]",
            "alItemName": "[parameters('al').context.item.name]",
            "alItemVersion": "[parameters('al').context.item.version.name]",
            "alConfigId": "[parameters('al').context.config.id]",
            "alConfigName": "[parameters('al').context.config.name]"
        },
        "name": "[concat(parameters('al').context.item.name, '.', replace(parameters('al').context.config.id, '-', ''), '.', parameters('al').context.item.id)]",
        "version": "[parameters('al').context.item.version.name]",
        "galleryName": "[variables('custom').gallery]",
        "generation": "[if(contains(variables('custom'), 'generation'), variables('custom').generation, 'V2')]",
        "trustedLaunch": "[if(contains(variables('custom'), 'trustedLaunch'), variables('custom').trustedLaunch, false())]"
    },
    "resources": [
        {
            "type": "Microsoft.Compute/galleries/images",
            "name": "[concat(variables('galleryName'), '/', variables('name'))]",
            "apiVersion": "2021-07-01",
            "location": "[variables('location')]",
            "tags": "[variables('tags')]",
            "properties": {
                "description": "[parameters('al').context.item.description]",
                "features": "[if(variables('trustedLaunch'), createArray(createObject('name', 'SecurityType', 'value', 'TrustedLaunch')), null())]",
                "hyperVGeneration": "[variables('generation')]",
                "osType": "Windows",
                "osState": "Specialized",
                "endOfLifeDate": "2030-01-01T00:00:00Z",
                "identifier": {
                    "publisher": "Citrix",
                    "offer": "[parameters('al').context.config.id]",
                    "sku": "[parameters('al').context.item.id]"
                }
            },
            "resources": [
                {
                    "type": "versions",
                    "apiVersion": "2021-07-01",
                    "name": "[variables('version')]",
                    "location": "[variables('location')]",
                    "dependsOn": [
                        "[resourceId('Microsoft.Compute/galleries/images', variables('galleryName'), variables('name'))]"
                    ],
                    "tags": "[variables('tags')]",
                    "properties": {
                        "publishingProfile": {
                            "replicaCount": 1,
                            "targetRegions": [
                                {
                                    "name": "[variables('location')]"
                                }
                            ]
                        },
                        "storageProfile": {
                            "osDiskImage": {
                                "source": {
                                    "id": "[parameters('al').input.source.diskId]"
                                }
                            }
                        }
                    }
                }
            ]
        }
    ],
    "outputs": {
        "id": {
            "type": "string",
            "value": "[resourceId('Microsoft.Compute/galleries/images/versions', variables('galleryName'), variables('name'), variables('version'))]"
        }
    }
}
<!--NeedCopy-->

计算机

计算机部署会创建虚拟机、NIC 和托管磁盘。无论是否指定引导映像部署,此模板均可使用。

计算机自定义数据

名称 说明 默认 必需
location 创建资源的区域。 与目标资源组相同的区域。
storageSku 已创建磁盘的 SKU 名称。 StandardSSD_LRS
generation 虚拟机的生成。 V2
值得信赖的启动 true 否则启用 “可信启动false”。 对于所有部署类型,该值必须相同。 false
安全重启 true 否则,false启用安全启动。这仅在设trustedLaunch置 为时适用 true true
vTPM true 以启用 vTPM, false否则。这仅在设trustedLaunch置 为时适用 true true
vmSize 要创建的 VM 的大小。 标准_D2S_v3
licenseType 适用于虚拟机的本地许可证类型。 null
subnetId 将 NIC 连接到的子网的资源 ID。 -

计算机模板

  • 1.1.0.0-增加了对可信启动的支持
  • 1.0.0.0-初始版本
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.1.0.0",
    "parameters": {
        "al": {
            "type": "object"
        }
    },
    "variables": {
        "custom": "[parameters('al').context.config.custom]",
        "location": "[if(contains(variables('custom'), 'location'), variables('custom').location, resourceGroup().location)]",
        "name": "[concat('al-', parameters('al').context.taskId)]",
        "vmName": "[concat(variables('name'), '-vm')]",
        "nicName": "[concat(variables('name'), '-nic')]",
        "diskName": "[concat(variables('name'), '-disk')]",
        "diskId": "[resourceId('Microsoft.Compute/disks', variables('diskName'))]",
        "tags": {
            "alTaskId": "[parameters('al').context.taskId]",
            "alUser": "[parameters('al').context.user]",
            "alComment": "[parameters('al').context.comment]",
            "alItemType": "[parameters('al').context.item.type]",
            "alItemId": "[parameters('al').context.item.id]",
            "alItemName": "[parameters('al').context.item.name]",
            "alItemVersion": "[parameters('al').context.item.version.name]",
            "alConfigId": "[parameters('al').context.config.id]",
            "alConfigName": "[parameters('al').context.config.name]"
        },
        "source": "[parameters('al').input.disk.image]",
        "isFromImage": "[not(contains(variables('source'), 'diskId'))]",
        "generation": "[if(contains(variables('custom'), 'generation'), variables('custom').generation, 'V2')]",
        "vmSize": "[if(contains(variables('custom'), 'vmSize'), variables('custom').vmSize, 'Standard_D2s_v3')]",
        "storageSku": "[if(contains(variables('custom'), 'storageSku'), variables('custom').storageSku, 'StandardSSD_LRS')]",
        "trustedLaunch": "[if(contains(variables('custom'), 'trustedLaunch'), variables('custom').trustedLaunch, false())]",
        "secureBoot": "[if(contains(variables('custom'), 'secureBoot'), variables('custom').secureBoot, variables('trustedLaunch'))]",
        "vTpm": "[if(contains(variables('custom'), 'vTpm'), variables('custom').vTpm, variables('trustedLaunch'))]",
        "securityProfile": {
            "securityType": "TrustedLaunch",
            "uefiSettings": {
                "secureBootEnabled": "[variables('secureBoot')]",
                "vTpmEnabled": "[variables('vTpm')]"
            }
        }
    },
    "resources": [
        {
            "type": "Microsoft.Network/networkInterfaces",
            "apiVersion": "2020-11-01",
            "name": "[variables('nicName')]",
            "location": "[variables('location')]",
            "tags": "[variables('tags')]",
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig1",
                        "properties": {
                            "privateIPAllocationMethod": "Dynamic",
                            "subnet": {
                                "id": "[variables('custom').subnetId]"
                            },
                            "primary": true,
                            "privateIPAddressVersion": "IPv4"
                        }
                    }
                ],
                "dnsSettings": {
                    "dnsServers": []
                },
                "enableAcceleratedNetworking": false,
                "enableIPForwarding": false
            }
        },
        {
            "condition": "[not(variables('isFromImage'))]",
            "type": "Microsoft.Compute/disks",
            "apiVersion": "2021-08-01",
            "name": "[variables('diskName')]",
            "location": "[variables('location')]",
            "tags": "[variables('tags')]",
            "sku": {
                "name": "[variables('storageSku')]"
            },
            "properties": {
                "osType": "Windows",
                "hyperVGeneration": "[variables('generation')]",
                "creationData": {
                    "createOption": "Copy",
                    "sourceResourceId": "[variables('source').diskId]"
                },
                "diskSizeGB": "[parameters('al').input.disk.size]",
                "networkAccessPolicy": "DenyAll",
                "publicNetworkAccess": "Disabled"
            }
        },
        {
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2021-07-01",
            "name": "[variables('vmName')]",
            "location": "[variables('location')]",
            "dependsOn": [
                "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]",
                "[variables('diskId')]"
            ],
            "tags": "[variables('tags')]",
            "properties": {
                "hardwareProfile": {
                    "vmSize": "[variables('vmSize')]"
                },
                "securityProfile": "[if(variables('trustedLaunch'), variables('securityProfile'), null())]",
                "storageProfile": {
                    "imageReference": "[if(variables('isFromImage'), createObject('id', variables('source').id), null())]",
                    "osDisk": {
                        "osType": "Windows",
                        "createOption": "[if(variables('isFromImage'), 'FromImage', 'Attach')]",
                        "caching": "ReadWrite",
                        "deleteOption": "Delete",
                        "diskSizeGB": "[parameters('al').input.disk.size]",
                        "managedDisk": "[if(variables('isFromImage'), createObject('storageAccountType', variables('storageSku')), createObject('id', variables('diskId')))]"
                    },
                    "dataDisks": []
                },
                "networkProfile": {
                    "networkInterfaces": [
                        {
                            "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
                        }
                    ]
                },
                "diagnosticsProfile": {
                    "bootDiagnostics": {
                        "enabled": true
                    }
                },
                "licenseType": "[if(contains(variables('custom'), 'licenseType'), variables('custom').licenseType, null())]",
                "userData": "[parameters('al').input.vm.userData]"
            }
        }
    ],
    "outputs": {
        "diskId": {
            "type": "string",
            "value": "[reference(variables('vmName')).storageProfile.osDisk.managedDisk.id]"
        },
        "message": {
            "type": "string",
            "value": "[format('See [link="{0}/#@{1}/resource/{2}"]{2}[/link].', environment().portal, tenant().tenantId, resourceId('Microsoft.Compute/virtualMachines', variables('vmName')))]"
        }
    }
}
<!--NeedCopy-->

分层映像

分层映像部署可以创建两种类型的资源:图库图像版本和/或托管磁盘。两种资源类型均使用正在发布的 App Layering 图像模板的名称及其构造的版本号命名。版本号是使用 App Layering 映像模板磁盘名称中的主要和次要编号构造的。如果磁盘名称未格式化为数字版本 (number.number), 则默认情况下将1.0应用。补丁号是 App Layering 图像模板的版本号(发布的次数)。为图库图像分配了名称,为图库图像版本分配了版本号。 为托管磁盘分配了附加版本号的名称。

图库图像和版本是在自定义数据指定的图库中创建的。多次发布图像时,会将新版本添加到计算库图像中,而旧版本保持不变。

分层图像自定义数据

R = 必填项,O = 可选,-= 未使用

名称 说明 默认 画廊图片 托管磁盘
publish 要创建的资源的类型。指定为由 “GalleryImage” 和/或 “ManagedDisk” 组成的数组或字符串 画廊图片 O R
location 创建资源的区域。 与目标资源组相同的区域 O O
generation 映像将支持的虚拟机的生成。 V2 O O
值得信赖的启动 true 否则启用 “可信启动false”。 对于所有部署类型,该值必须相同。 false O O
用于在其中创建映像的计算库的名称。库必须位于目标资源组中。 - R -
副本计数 图库图像版本每个区域的默认副本数 1 O -
目标区域 图库图像版本的目标区域。它被指定为区域名称字符串和/或 TargetRegion 对象的数组。该阵列必须包含源磁盘的区域(由 自location定义数据指定)。 自定义数据指定的location区域 O -
storageSku 要使用的 SKU 的名称。 StandardSSD_LRS - O
diskAccessId 上传磁盘内容时使用的磁盘访问权限的资源 ID。如果指定,则在禁用公共网络访问的情况下创建磁盘。 null - O

分层图像模板

  • 1.1.0.0
    • 增加了对可信启动的支持
    • 为图库图像版本增加了副本数量和目标区域支持
    • 增加了对作为托管磁盘发布的支持
  • 1.0.0.0-初始版本
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.1.0.0",
    "parameters": {
        "al": {
            "type": "object"
        }
    },
    "variables": {
        "invalidChars": [ " ", "(", ")", "[[", "]", "{", "}", "!", "@", "#", "$", "%", "^", "&", "\*", "+", "/", "\\", "'", """, "|", "`", "~", "<", ">", ",", "?", "\*" ],
        "numericChars": [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ],
        "custom": "[parameters('al').context.config.custom]",
        "location": "[if(contains(variables('custom'), 'location'), variables('custom').location, resourceGroup().location)]",
        "name": "[join(split(parameters('al').context.item.name, variables('invalidChars')), '\_')]",
        "tags": {
            "alTaskId": "[parameters('al').context.taskId]",
            "alUser": "[parameters('al').context.user]",
            "alComment": "[parameters('al').context.comment]",
            "alItemType": "[parameters('al').context.item.type]",
            "alItemId": "[parameters('al').context.item.id]",
            "alItemName": "[parameters('al').context.item.name]",
            "alItemVersion": "[parameters('al').context.item.version.name]",
            "alConfigId": "[parameters('al').context.config.id]",
            "alConfigName": "[parameters('al').context.config.name]"
        },
        "splitVer": "[split(parameters('al').input.diskName, '.')]",
        "major": "[if(equals(0, length(join(split(variables('splitVer')[0], variables('numericChars')), ''))), variables('splitVer')[0], '1')]",
        "minor": "[if(greater(length(variables('splitVer')), 1), if(equals(0, length(join(split(variables('splitVer')[1], variables('numericChars')), ''))), variables('splitVer')[1], '0'), '0')]",
        "version": "[format('{0}.{1}.{2}', variables('major'), variables('minor'), parameters('al').context.item.version.number)]",
        "galleryName": "[variables('custom').gallery]",
        "generation": "[if(contains(variables('custom'), 'generation'), variables('custom').generation, 'V2')]",
        "trustedLaunch": "[if(contains(variables('custom'), 'trustedLaunch'), variables('custom').trustedLaunch, false())]",
        "replicaCount": "[if(contains(variables('custom'), 'replicaCount'), variables('custom').replicaCount, 1)]",
        "targetRegions": "[if(contains(variables('custom'), 'targetRegions'), variables('custom').targetRegions, createArray(variables('location')))]",
        "diskName": "[format('{0}\_{1}-{2}-{3}', variables('name'), variables('major'), variables('minor'), parameters('al').context.item.version.number)]",
        "hasDiskAccess": "[contains(variables('custom'), 'diskAccessId')]",
        "storageSku": "[if(contains(variables('custom'), 'storageSku'), variables('custom').storageSku, 'StandardSSD_LRS')]",
        "publishAs": "[if(contains(variables('custom'), 'publishAs'), variables('custom').publishAs, createArray('galleryImage'))]",
        "galleryLink": "[format('[link="{0}/#@{1}/resource/{2}"]{2}[/link].', environment().portal, tenant().tenantId, resourceId('Microsoft.Compute/galleries/images/versions', variables('galleryName'), variables('name'), variables('version')))]",
        "diskLink": "[format('[link="{0}/#@{1}/resource/{2}"]{2}[/link].', environment().portal, tenant().tenantId, resourceId('Microsoft.Compute/disks', variables('diskName')))]",
        "outputLinks": "[filter(createArray(if(contains(variables('publishAs'), 'galleryImage'), variables('galleryLink'), null()), if(contains(variables('publishAs'), 'managedDisk'), variables('diskLink'), null())), lambda('link', not(equals(lambdaVariables('link'), null()))))]"
    },
    "resources": [
        {
            "condition": "[contains(variables('publishAs'), 'galleryImage')]",
            "type": "Microsoft.Compute/galleries/images",
            "name": "[format('{0}/{1}', variables('galleryName'), variables('name'))]",
            "apiVersion": "2021-07-01",
            "location": "[variables('location')]",
            "properties": {
                "description": "[parameters('al').context.item.description]",
                "features": "[if(variables('trustedLaunch'), createArray(createObject('name', 'SecurityType', 'value', 'TrustedLaunch')), null())]",
                "hyperVGeneration": "[variables('generation')]",
                "osType": "Windows",
                "osState": "Specialized",
                "endOfLifeDate": "2030-01-01T00:00:00Z",
                "identifier": {
                    "publisher": "AppLayering",
                    "offer": "[variables('name')]",
                    "sku": "[variables('generation')]"
                }
            },
            "tags": "[variables('tags')]",
            "resources": [
                {
                    "condition": "[contains(variables('publishAs'), 'galleryImage')]",
                    "type": "versions",
                    "apiVersion": "2022-03-03",
                    "name": "[variables('version')]",
                    "location": "[variables('location')]",
                    "dependsOn": [
                        "[resourceId('Microsoft.Compute/galleries/images', variables('galleryName'), variables('name'))]"
                    ],
                    "tags": "[variables('tags')]",
                    "properties": {
                        "publishingProfile": {
                            "replicaCount": "[variables('replicaCount')]",
                            "targetRegions": "[map(variables('targetRegions'), lambda('item', if(contains(lambdaVariables('item'), 'name'), lambdaVariables('item'), createObject('name', lambdaVariables('item')))))]"
                        },
                        "storageProfile": {
                            "osDiskImage": {
                                "source": {
                                    "id": "[parameters('al').input.source.diskId]"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "condition": "[contains(variables('publishAs'), 'managedDisk')]",
            "type": "Microsoft.Compute/disks",
            "apiVersion": "2021-08-01",
            "name": "[variables('diskName')]",
            "location": "[variables('location')]",
            "tags": "[variables('tags')]",
            "sku": {
                "name": "[variables('storageSku')]"
            },
            "properties": {
                "osType": "Windows",
                "hyperVGeneration": "[variables('generation')]",
                "creationData": {
                    "createOption": "Copy",
                    "sourceResourceId": "[parameters('al').input.source.diskId]"
                },
                "diskAccessId": "[if(variables('hasDiskAccess'), variables('custom').diskAccessId, null())]",
                "networkAccessPolicy": "[if(variables('hasDiskAccess'), 'AllowPrivate', 'AllowAll')]",
                "publicNetworkAccess": "[if(variables('hasDiskAccess'), 'Disabled', 'Enabled')]"
            }
        }
    ],
    "outputs": {
        "message": {
            "type": "string",
            "value": "[if(empty(variables('outputLinks')), null(), format('See {0}.', join(variables('outputLinks'), ' and ')))]"
        }
    }
}
<!--NeedCopy-->
入门模板