Created
May 1, 2020 21:53
-
-
Save shurick81/50dd1ff56a66d3229e77a4de2858e06b to your computer and use it in GitHub Desktop.
az-300-2VMs-2RSVs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"variables": { | |
"storageAccountName": "[uniquestring(resourceGroup().id)]" | |
}, | |
"resources": [ | |
{ | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2018-11-01", | |
"name": "[variables('storageAccountName')]", | |
"location": "westeurope", | |
"sku": { | |
"name": "Standard_LRS" | |
}, | |
"kind": "Storage", | |
"properties": {} | |
}, | |
{ | |
"type": "Microsoft.Network/publicIPAddresses", | |
"apiVersion": "2018-11-01", | |
"name": "00", | |
"location": "westeurope", | |
"properties": { | |
"publicIPAllocationMethod": "Dynamic" | |
} | |
}, | |
{ | |
"comments": "Default Network Security Group for template", | |
"type": "Microsoft.Network/networkSecurityGroups", | |
"apiVersion": "2019-08-01", | |
"name": "00", | |
"location": "westeurope", | |
"properties": { | |
"securityRules": [] | |
} | |
}, | |
{ | |
"type": "Microsoft.Network/virtualNetworks", | |
"apiVersion": "2018-11-01", | |
"name": "00", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Network/networkSecurityGroups', '00')]" | |
], | |
"properties": { | |
"addressSpace": { | |
"addressPrefixes": [ | |
"10.0.0.0/16" | |
] | |
}, | |
"subnets": [ | |
{ | |
"name": "00", | |
"properties": { | |
"addressPrefix": "10.0.0.0/24", | |
"networkSecurityGroup": { | |
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', '00')]" | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"type": "Microsoft.Network/networkInterfaces", | |
"apiVersion": "2018-11-01", | |
"name": "00", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Network/publicIPAddresses/', '00')]", | |
"[resourceId('Microsoft.Network/virtualNetworks/', '00')]" | |
], | |
"properties": { | |
"ipConfigurations": [ | |
{ | |
"name": "ipconfig1", | |
"properties": { | |
"privateIPAllocationMethod": "Dynamic", | |
"publicIPAddress": { | |
"id": "[resourceId('Microsoft.Network/publicIPAddresses','00')]" | |
}, | |
"subnet": { | |
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', '00', '00')]" | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"type": "Microsoft.Compute/virtualMachines", | |
"apiVersion": "2018-10-01", | |
"name": "VM1", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", | |
"[resourceId('Microsoft.Network/networkInterfaces', '00')]" | |
], | |
"properties": { | |
"hardwareProfile": { | |
"vmSize": "Standard_A2_v2" | |
}, | |
"osProfile": { | |
"computerName": "VM1", | |
"adminUsername": "shurick81", | |
"adminPassword": "c0mp1Expa~~" | |
}, | |
"storageProfile": { | |
"imageReference": { | |
"publisher": "Canonical", | |
"offer": "UbuntuServer", | |
"sku": "19.10-DAILY", | |
"version": "19.10.202004290" | |
}, | |
"osDisk": { | |
"createOption": "FromImage" | |
}, | |
"dataDisks": [] | |
}, | |
"networkProfile": { | |
"networkInterfaces": [ | |
{ | |
"id": "[resourceId('Microsoft.Network/networkInterfaces','00')]" | |
} | |
] | |
}, | |
"diagnosticsProfile": { | |
"bootDiagnostics": { | |
"enabled": true, | |
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob]" | |
} | |
} | |
} | |
}, | |
{ | |
"type": "Microsoft.RecoveryServices/vaults", | |
"apiVersion": "2018-01-10", | |
"name": "RSV1", | |
"location": "westeurope", | |
"sku": { | |
"name": "RS0", | |
"tier": "Standard" | |
}, | |
"properties": {} | |
}, | |
{ | |
"type": "Microsoft.Network/publicIPAddresses", | |
"apiVersion": "2018-11-01", | |
"name": "01", | |
"location": "westeurope", | |
"properties": { | |
"publicIPAllocationMethod": "Dynamic" | |
} | |
}, | |
{ | |
"comments": "Default Network Security Group for template", | |
"type": "Microsoft.Network/networkSecurityGroups", | |
"apiVersion": "2019-08-01", | |
"name": "01", | |
"location": "westeurope", | |
"properties": { | |
"securityRules": [] | |
} | |
}, | |
{ | |
"type": "Microsoft.Network/virtualNetworks", | |
"apiVersion": "2018-11-01", | |
"name": "01", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Network/networkSecurityGroups', '01')]" | |
], | |
"properties": { | |
"addressSpace": { | |
"addressPrefixes": [ | |
"10.0.0.0/16" | |
] | |
}, | |
"subnets": [ | |
{ | |
"name": "01", | |
"properties": { | |
"addressPrefix": "10.0.0.0/24", | |
"networkSecurityGroup": { | |
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', '01')]" | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"type": "Microsoft.Network/networkInterfaces", | |
"apiVersion": "2018-11-01", | |
"name": "01", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Network/publicIPAddresses/', '01')]", | |
"[resourceId('Microsoft.Network/virtualNetworks/', '01')]" | |
], | |
"properties": { | |
"ipConfigurations": [ | |
{ | |
"name": "ipconfig1", | |
"properties": { | |
"privateIPAllocationMethod": "Dynamic", | |
"publicIPAddress": { | |
"id": "[resourceId('Microsoft.Network/publicIPAddresses','01')]" | |
}, | |
"subnet": { | |
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', '01', '01')]" | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"type": "Microsoft.Compute/virtualMachines", | |
"apiVersion": "2018-10-01", | |
"name": "VM2", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", | |
"[resourceId('Microsoft.Network/networkInterfaces', '01')]" | |
], | |
"properties": { | |
"hardwareProfile": { | |
"vmSize": "Standard_A2_v2" | |
}, | |
"osProfile": { | |
"computerName": "VM2", | |
"adminUsername": "shurick81", | |
"adminPassword": "c0mp1Expa~~" | |
}, | |
"storageProfile": { | |
"imageReference": { | |
"publisher": "Canonical", | |
"offer": "UbuntuServer", | |
"sku": "19.10-DAILY", | |
"version": "19.10.202004290" | |
}, | |
"osDisk": { | |
"createOption": "FromImage" | |
}, | |
"dataDisks": [] | |
}, | |
"networkProfile": { | |
"networkInterfaces": [ | |
{ | |
"id": "[resourceId('Microsoft.Network/networkInterfaces','01')]" | |
} | |
] | |
}, | |
"diagnosticsProfile": { | |
"bootDiagnostics": { | |
"enabled": true, | |
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob]" | |
} | |
} | |
} | |
}, | |
{ | |
"type": "Microsoft.RecoveryServices/vaults", | |
"apiVersion": "2018-01-10", | |
"name": "RSV2", | |
"location": "westeurope", | |
"sku": { | |
"name": "RS0", | |
"tier": "Standard" | |
}, | |
"properties": {} | |
}, | |
{ | |
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems", | |
"apiVersion": "2016-06-01", | |
"name": "[concat('RSV1/Azure/iaasvmcontainer;iaasvmcontainerv2;', resourceGroup().name, ';VM2/vm;iaasvmcontainerv2;', resourceGroup().name, ';VM2')]", | |
"properties": { | |
"protectedItemType": "Microsoft.ClassicCompute/virtualMachines", | |
"policyId": "[resourceId('Microsoft.RecoveryServices/vaults/backupPolicies', 'RSV1', 'DefaultPolicy')]", | |
"sourceResourceId": "[concat('/subscriptions/d7c7a3af-f74f-4007-845c-dcacef601c53/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Compute/virtualMachines/VM2')]" | |
}, | |
"dependsOn": [ | |
"[resourceId('Microsoft.Compute/virtualMachines', 'VM2')]", | |
"[resourceId('Microsoft.RecoveryServices/vaults', 'RSV1')]" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment