|
48 | 48 | "subnetPrefix": "10.0.0.0/24", |
49 | 49 | "storageAccountName": "[concat('sa', uniquestring(resourceGroup().id))]", |
50 | 50 | "storageAccountType": "Standard_LRS", |
51 | | - "publicIPAddressName": "[tolower(concat('pip',uniquestring(resourceGroup().id)))]", |
52 | | - "publicIPAddressType": "Dynamic", |
53 | 51 | "vmStorageAccountContainerName": "vhds", |
54 | | - "vmName": "[concat('vm', resourceGroup().name)]", |
| 52 | + "vmName": "[substring(concat('simplelinuxvm',resourceGroup().Name),0,14)]", |
55 | 53 | "vmSize": "Standard_A1", |
56 | 54 | "virtualNetworkName": "[tolower(concat('vnet',uniquestring(resourceGroup().id)))]", |
57 | 55 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]", |
|
90 | 88 | } |
91 | 89 | } |
92 | 90 | ] |
93 | | - } |
94 | | - }, |
95 | | - { |
96 | | - "apiVersion": "2015-05-01-preview", |
97 | | - "type": "Microsoft.Network/publicIPAddresses", |
98 | | - "name": "[variables('publicIPAddressName')]", |
99 | | - "location": "[variables('location')]", |
100 | | - "properties": { |
101 | | - "publicIPAllocationMethod": "[variables('publicIPAddressType')]", |
102 | | - "dnsSettings": { |
103 | | - "domainNameLabel": "[variables('dnsNameForPublicIP')]" |
| 91 | + } |
| 92 | + }, |
| 93 | + { |
| 94 | + "apiVersion": "2015-05-01-preview", |
| 95 | + "type": "Microsoft.Network/virtualNetworks", |
| 96 | + "name": "[variables('virtualNetworkName')]", |
| 97 | + "location": "[variables('location')]", |
| 98 | + "properties": { |
| 99 | + "addressSpace": { |
| 100 | + "addressPrefixes": [ |
| 101 | + "[variables('addressPrefix')]" |
| 102 | + ] |
| 103 | + }, |
| 104 | + "subnets": [ |
| 105 | + { |
| 106 | + "name": "[variables('subnetName')]", |
| 107 | + "properties": { |
| 108 | + "addressPrefix": "[variables('subnetPrefix')]" |
| 109 | + } |
104 | 110 | } |
105 | | - } |
106 | | - }, |
107 | | - { |
108 | | - "apiVersion": "2015-05-01-preview", |
109 | | - "type": "Microsoft.Network/virtualNetworks", |
110 | | - "name": "[variables('virtualNetworkName')]", |
111 | | - "location": "[variables('location')]", |
112 | | - "properties": { |
113 | | - "addressSpace": { |
114 | | - "addressPrefixes": [ |
115 | | - "[variables('addressPrefix')]" |
116 | | - ] |
117 | | - }, |
118 | | - "subnets": [ |
119 | | - { |
120 | | - "name": "[variables('subnetName')]", |
121 | | - "properties": { |
122 | | - "addressPrefix": "[variables('subnetPrefix')]" |
| 111 | + ] |
| 112 | + } |
| 113 | + }, |
| 114 | + { |
| 115 | + "apiVersion": "2015-05-01-preview", |
| 116 | + "type": "Microsoft.Network/networkInterfaces", |
| 117 | + "name": "[variables('nicName')]", |
| 118 | + "location": "[variables('location')]", |
| 119 | + "dependsOn": [ |
| 120 | + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]", |
| 121 | + "[variables('networkSecurityGroupName')]" |
| 122 | + ], |
| 123 | + "properties": { |
| 124 | + "networkSecurityGroup": { |
| 125 | + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" |
| 126 | + }, |
| 127 | + "ipConfigurations": [ |
| 128 | + { |
| 129 | + "name": "ipconfig1", |
| 130 | + "properties": { |
| 131 | + "privateIPAllocationMethod": "Dynamic", |
| 132 | + "subnet": { |
| 133 | + "id": "[variables('subnetRef')]" |
123 | 134 | } |
124 | 135 | } |
125 | | - ] |
126 | | - } |
127 | | - }, |
128 | | - { |
129 | | - "apiVersion": "2015-05-01-preview", |
130 | | - "type": "Microsoft.Network/networkInterfaces", |
131 | | - "name": "[variables('nicName')]", |
132 | | - "location": "[variables('location')]", |
133 | | - "dependsOn": [ |
134 | | - "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", |
135 | | - "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]", |
136 | | - "[variables('networkSecurityGroupName')]" |
137 | | - ], |
138 | | - "properties": { |
139 | | - "networkSecurityGroup": { |
140 | | - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" |
| 136 | + } |
| 137 | + ] |
| 138 | + } |
| 139 | + }, |
| 140 | + { |
| 141 | + "apiVersion": "2015-06-15", |
| 142 | + "type": "Microsoft.Compute/virtualMachines", |
| 143 | + "name": "[variables('vmName')]", |
| 144 | + "location": "[variables('location')]", |
| 145 | + "dependsOn": [ |
| 146 | + "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]", |
| 147 | + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" |
| 148 | + ], |
| 149 | + "properties": { |
| 150 | + "hardwareProfile": { |
| 151 | + "vmSize": "[variables('vmSize')]" |
| 152 | + }, |
| 153 | + "osProfile": { |
| 154 | + "computerName": "[variables('vmName')]", |
| 155 | + "adminUsername": "[parameters('adminUsername')]", |
| 156 | + "adminPassword": "[parameters('adminPassword')]" |
| 157 | + }, |
| 158 | + "storageProfile": { |
| 159 | + "imageReference": { |
| 160 | + "publisher": "[parameters('imagePublisher')]", |
| 161 | + "offer": "[parameters('imageOffer')]", |
| 162 | + "sku": "[parameters('imageSku')]", |
| 163 | + "version": "latest" |
141 | 164 | }, |
142 | | - "ipConfigurations": [ |
| 165 | + "osDisk": { |
| 166 | + "name": "osdisk", |
| 167 | + "vhd": { |
| 168 | + "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmStorageAccountContainerName'),'/', variables('OSDiskName'), '.vhd')]" |
| 169 | + }, |
| 170 | + "caching": "ReadWrite", |
| 171 | + "createOption": "FromImage" |
| 172 | + } |
| 173 | + }, |
| 174 | + "networkProfile": { |
| 175 | + "networkInterfaces": [ |
143 | 176 | { |
144 | | - "name": "ipconfig1", |
145 | | - "properties": { |
146 | | - "privateIPAllocationMethod": "Dynamic", |
147 | | - "publicIPAddress": { |
148 | | - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" |
149 | | - }, |
150 | | - "subnet": { |
151 | | - "id": "[variables('subnetRef')]" |
152 | | - } |
153 | | - } |
| 177 | + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" |
154 | 178 | } |
155 | 179 | ] |
156 | | - } |
157 | | - }, |
158 | | - { |
159 | | - "apiVersion": "2015-06-15", |
160 | | - "type": "Microsoft.Compute/virtualMachines", |
161 | | - "name": "[variables('vmName')]", |
162 | | - "location": "[variables('location')]", |
163 | | - "dependsOn": [ |
164 | | - "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]", |
165 | | - "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" |
166 | | - ], |
167 | | - "properties": { |
168 | | - "hardwareProfile": { |
169 | | - "vmSize": "[variables('vmSize')]" |
170 | | - }, |
171 | | - "osProfile": { |
172 | | - "computerName": "[variables('vmName')]", |
173 | | - "adminUsername": "[parameters('adminUsername')]", |
174 | | - "adminPassword": "[parameters('adminPassword')]" |
175 | | - }, |
176 | | - "storageProfile": { |
177 | | - "imageReference": { |
178 | | - "publisher": "[parameters('imagePublisher')]", |
179 | | - "offer": "[parameters('imageOffer')]", |
180 | | - "sku": "[parameters('imageSku')]", |
181 | | - "version": "latest" |
182 | | - }, |
183 | | - "osDisk": { |
184 | | - "name": "osdisk", |
185 | | - "vhd": { |
186 | | - "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmStorageAccountContainerName'),'/', variables('OSDiskName'), '.vhd')]" |
187 | | - }, |
188 | | - "caching": "ReadWrite", |
189 | | - "createOption": "FromImage" |
190 | | - } |
191 | | - }, |
192 | | - "networkProfile": { |
193 | | - "networkInterfaces": [ |
194 | | - { |
195 | | - "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" |
196 | | - } |
197 | | - ] |
198 | | - }, |
199 | | - "diagnosticsProfile": { |
200 | | - "bootDiagnostics": { |
201 | | - "enabled": "true", |
202 | | - "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob)]" |
203 | | - } |
| 180 | + }, |
| 181 | + "diagnosticsProfile": { |
| 182 | + "bootDiagnostics": { |
| 183 | + "enabled": "true", |
| 184 | + "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob)]" |
204 | 185 | } |
205 | 186 | } |
206 | 187 | } |
207 | | - ] |
208 | 188 | } |
| 189 | + ] |
| 190 | +} |
0 commit comments