You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.0 KiB

  1. {
  2. "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  3. "contentVersion": "1.0.0.0",
  4. "parameters": {
  5. },
  6. "variables": {
  7. "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', '{{virtualNetworkName}}')]",
  8. "subnetAdminRef": "[concat(variables('vnetID'),'/subnets/', '{{subnetAdminName}}')]"
  9. },
  10. "resources": [
  11. {% if use_bastion %}
  12. {
  13. "apiVersion": "{{apiVersion}}",
  14. "type": "Microsoft.Network/publicIPAddresses",
  15. "name": "{{bastionIPAddressName}}",
  16. "location": "[resourceGroup().location]",
  17. "properties": {
  18. "publicIPAllocationMethod": "Static"
  19. }
  20. },
  21. {
  22. "apiVersion": "{{apiVersion}}",
  23. "type": "Microsoft.Network/networkInterfaces",
  24. "name": "{{bastionVMName}}-nic",
  25. "location": "[resourceGroup().location]",
  26. "dependsOn": [
  27. "[concat('Microsoft.Network/publicIPAddresses/', '{{bastionIPAddressName}}')]"
  28. ],
  29. "properties": {
  30. "ipConfigurations": [
  31. {
  32. "name": "BastionIpConfig",
  33. "properties": {
  34. "privateIPAllocationMethod": "Dynamic",
  35. "publicIPAddress": {
  36. "id": "[resourceId('Microsoft.Network/publicIPAddresses', '{{bastionIPAddressName}}')]"
  37. },
  38. "subnet": {
  39. "id": "[variables('subnetAdminRef')]"
  40. }
  41. }
  42. }
  43. ]
  44. }
  45. },
  46. {
  47. "apiVersion": "{{apiVersion}}",
  48. "type": "Microsoft.Compute/virtualMachines",
  49. "name": "{{bastionVMName}}",
  50. "location": "[resourceGroup().location]",
  51. "dependsOn": [
  52. "[concat('Microsoft.Network/networkInterfaces/', '{{bastionVMName}}-nic')]"
  53. ],
  54. "tags": {
  55. "roles": "bastion"
  56. },
  57. "properties": {
  58. "hardwareProfile": {
  59. "vmSize": "{{bastionVmSize}}"
  60. },
  61. "osProfile": {
  62. "computerName": "{{bastionVMName}}",
  63. "adminUsername": "{{admin_username}}",
  64. "adminPassword": "{{admin_password}}",
  65. "linuxConfiguration": {
  66. "disablePasswordAuthentication": "true",
  67. "ssh": {
  68. "publicKeys": [
  69. {
  70. "path": "{{sshKeyPath}}",
  71. "keyData": "{{ssh_public_key}}"
  72. }
  73. ]
  74. }
  75. }
  76. },
  77. "storageProfile": {
  78. "imageReference": {{imageReferenceJson}},
  79. "osDisk": {
  80. "name": "osdisk",
  81. "vhd": {
  82. "uri": "[concat('http://', '{{storageAccountName}}', '.blob.core.windows.net/vhds/', '{{bastionVMName}}', '-osdisk.vhd')]"
  83. },
  84. "caching": "ReadWrite",
  85. "createOption": "FromImage"
  86. }
  87. },
  88. "networkProfile": {
  89. "networkInterfaces": [
  90. {
  91. "id": "[resourceId('Microsoft.Network/networkInterfaces', '{{bastionVMName}}-nic')]"
  92. }
  93. ]
  94. }
  95. }
  96. }
  97. {% endif %}
  98. ]
  99. }