github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment05.approved.json (about)

     1  {
     2    "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
     3    "contentVersion": "1.0.0.0",
     4    "parameters": {
     5      "adminPassword": {
     6        "type": "string"
     7      },
     8      "adminUsername": {
     9        "type": "string"
    10      },
    11      "dnsNameForPublicIP": {
    12        "type": "string"
    13      },
    14      "nicName": {
    15        "type": "string"
    16      },
    17      "osDiskName": {
    18        "type": "string"
    19      },
    20      "publicIPAddressName": {
    21        "type": "string"
    22      },
    23      "storageAccountBlobEndpoint": {
    24        "type": "string"
    25      },
    26      "subnetName": {
    27        "type": "string"
    28      },
    29      "virtualNetworkName": {
    30        "type": "string"
    31      },
    32      "vmName": {
    33        "type": "string"
    34      },
    35      "vmSize": {
    36        "type": "string"
    37      }
    38    },
    39    "resources": [
    40      {
    41        "apiVersion": "[variables('networkInterfacesApiVersion')]",
    42        "dependsOn": [],
    43        "location": "[variables('location')]",
    44        "name": "[parameters('nicName')]",
    45        "properties": {
    46          "ipConfigurations": [
    47            {
    48              "name": "ipconfig",
    49              "properties": {
    50                "privateIPAllocationMethod": "Dynamic",
    51                "subnet": {
    52                  "id": "[variables('subnetRef')]"
    53                }
    54              }
    55            }
    56          ]
    57        },
    58        "type": "Microsoft.Network/networkInterfaces"
    59      },
    60      {
    61        "apiVersion": "[variables('apiVersion')]",
    62        "dependsOn": [
    63          "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
    64        ],
    65        "location": "[variables('location')]",
    66        "name": "[parameters('vmName')]",
    67        "properties": {
    68          "diagnosticsProfile": {
    69            "bootDiagnostics": {
    70              "enabled": false
    71            }
    72          },
    73          "hardwareProfile": {
    74            "vmSize": "[parameters('vmSize')]"
    75          },
    76          "networkProfile": {
    77            "networkInterfaces": [
    78              {
    79                "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
    80              }
    81            ]
    82          },
    83          "osProfile": {
    84            "adminPassword": "[parameters('adminPassword')]",
    85            "adminUsername": "[parameters('adminUsername')]",
    86            "computerName": "[parameters('vmName')]",
    87            "linuxConfiguration": {
    88              "ssh": {
    89                "publicKeys": [
    90                  {
    91                    "keyData": "",
    92                    "path": "[variables('sshKeyPath')]"
    93                  }
    94                ]
    95              }
    96            }
    97          },
    98          "storageProfile": {
    99            "osDisk": {
   100              "caching": "ReadWrite",
   101              "createOption": "FromImage",
   102              "image": {
   103                "uri": "https://localhost/custom.vhd"
   104              },
   105              "name": "[parameters('osDiskName')]",
   106              "osType": "Linux",
   107              "vhd": {
   108                "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
   109              }
   110            }
   111          }
   112        },
   113        "type": "Microsoft.Compute/virtualMachines"
   114      }
   115    ],
   116    "variables": {
   117      "addressPrefix": "10.0.0.0/16",
   118      "apiVersion": "2017-03-30",
   119      "location": "[resourceGroup().location]",
   120      "managedDiskApiVersion": "2017-03-30",
   121      "networkInterfacesApiVersion": "2017-04-01",
   122      "publicIPAddressApiVersion": "2017-04-01",
   123      "publicIPAddressType": "Dynamic",
   124      "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
   125      "subnetAddressPrefix": "10.0.0.0/24",
   126      "subnetName": "virtualNetworkSubnetName",
   127      "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
   128      "virtualNetworkName": "virtualNetworkName",
   129      "virtualNetworkResourceGroup": "virtualNetworkResourceGroupName",
   130      "virtualNetworksApiVersion": "2017-04-01",
   131      "vmStorageAccountContainerName": "images",
   132      "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
   133    }
   134  }