Skip to content

Commit 1f6a4c6

Browse files
committed
feat(VSECPC-12285): Azure | ARM Templates enhancements
1 parent d7d4c9e commit 1f6a4c6

19 files changed

Lines changed: 653 additions & 86 deletions

File tree

azure/templates/marketplace-gateway-load-balancer/createUiDefinition.json

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,35 @@
13611361
},
13621362
"visible": "[steps('network').NSG]"
13631363
},
1364+
{
1365+
"name": "storageAccountDeployMode",
1366+
"type": "Microsoft.Common.DropDown",
1367+
"label": "Storage Account Deployment Mode",
1368+
"toolTip": "Select your preferred Storage Account deployment mode, New to a new Storage Account, Existing to an existing Storage Account, Managed to managed Storage Account, None to deploy without a Storage Account",
1369+
"defaultValue": "New",
1370+
"constraints": {
1371+
"allowedValues": [
1372+
{
1373+
"label": "New",
1374+
"value": "New"
1375+
},
1376+
{
1377+
"label": "Existing",
1378+
"value": "Existing"
1379+
},
1380+
{
1381+
"label": "Managed",
1382+
"value": "Managed"
1383+
},
1384+
{
1385+
"label": "None",
1386+
"value": "None"
1387+
}
1388+
],
1389+
"required": true
1390+
},
1391+
"visible": true
1392+
},
13641393
{
13651394
"name": "addStorageAccountIpRules",
13661395
"type": "Microsoft.Common.OptionsGroup",
@@ -1378,9 +1407,48 @@
13781407
"value": true
13791408
}
13801409
],
1381-
"required": true
1410+
"required": "[equals(steps('network').storageAccountDeployMode, 'New')]"
13821411
},
1383-
"visible": true
1412+
"visible": "[equals(steps('network').storageAccountDeployMode, 'New')]"
1413+
},
1414+
{
1415+
"name": "existingStorageAccount",
1416+
"type": "Microsoft.Solutions.ResourceSelector",
1417+
"label": "Storage Account",
1418+
"defaultValue": "null",
1419+
"toolTip": "Choose an existing Storage Account",
1420+
"resourceType": "Microsoft.Storage/storageAccounts",
1421+
"constraints": {
1422+
"required": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
1423+
},
1424+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
1425+
},
1426+
{
1427+
"name": "infoExistingStorageAccount",
1428+
"type": "Microsoft.Common.InfoBox",
1429+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]",
1430+
"options": {
1431+
"icon": "Info",
1432+
"text": "The Storage Account must allow network access from the Serial Console feature, for more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Serial Console Security</a>."
1433+
}
1434+
},
1435+
{
1436+
"name": "infoManagedStorageAccount",
1437+
"type": "Microsoft.Common.InfoBox",
1438+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Managed')]",
1439+
"options": {
1440+
"icon": "Info",
1441+
"text": "Azure will use a managed Storage Account for the deployment, no additional configuration is required."
1442+
}
1443+
},
1444+
{
1445+
"name": "warningNoneStorageAccount",
1446+
"type": "Microsoft.Common.InfoBox",
1447+
"visible": "[equals(steps('network').storageAccountDeployMode, 'None')]",
1448+
"options": {
1449+
"icon": "Warning",
1450+
"text": "Please note that deploying without a Storage Account will not allow you to use the Serial Console feature. For more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Azure Serial Console</a>."
1451+
}
13841452
}
13851453
]
13861454
},
@@ -1454,9 +1522,11 @@
14541522
"deployNewNSG": "[steps('network').NSG]",
14551523
"ExistingNSG": "[steps('network').nsgSelector]",
14561524
"NewNsgName": "[steps('network').NSGName]",
1525+
"storageAccountDeployMode": "[steps('network').storageAccountDeployMode]",
14571526
"addStorageAccountIpRules":"[steps('network').addStorageAccountIpRules]",
1527+
"existingStorageAccountId": "[steps('network').existingStorageAccount]",
14581528
"SerialConsolePasswordHash": "[steps('chkp-advanced').AdditionalPassword]",
14591529
"MaintenanceModePasswordHash": "[steps('chkp-advanced').MaintenanceModePassword]"
14601530
}
14611531
}
1462-
}
1532+
}

azure/templates/marketplace-gateway-load-balancer/mainTemplate.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,19 +399,39 @@
399399
"type": "string",
400400
"defaultValue": "[concat(parameters('vmName'),'-nsg')]"
401401
},
402+
"storageAccountDeployMode": {
403+
"type": "string",
404+
"defaultValue": "New",
405+
"metadata": {
406+
"description": "Choose the Storage Account mode: 'New' creates a new account, 'Existing' uses one already available, 'Managed' provisions a managed account, and 'None' skips account creation."
407+
},
408+
"allowedValues": [
409+
"New",
410+
"Existing",
411+
"Managed",
412+
"None"
413+
]
414+
},
402415
"addStorageAccountIpRules": {
403416
"type": "bool",
404417
"metadata": {
405-
"description": "Add Storage Account IP rules that allow access to the Serial Console only for IPs based on their geographic location, based on https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-linux#use-serial-console-with-custom-boot-diagnostics-storage-account-firewall-enabled"
418+
"description": "Add Storage Account IP rules that allow access to the Serial Console only for IPs based on their geographic location, based on https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-linux#use-serial-console-with-custom-boot-diagnostics-storage-account-firewall-enabled. Only relevant when 'Storage Account Deploy Mode' is set to 'New'."
406419
},
407420
"defaultValue": false
408421
},
409422
"storageAccountAdditionalIps": {
410423
"type": "array",
411424
"metadata": {
412-
"description": "IPs/CIDRs that are allowed access to the Storage Account. Format should be an array of strings."
425+
"description": "IPs/CIDRs that are allowed access to the Storage Account. Format should be an array of strings. Only relevant when 'Storage Account Deploy Mode' is set to 'New'."
413426
},
414427
"defaultValue": []
428+
},
429+
"existingStorageAccountId": {
430+
"type": "string",
431+
"metadata": {
432+
"description": "The ID of the existing Storage Account. Only relevant when 'Storage Account Deploy Mode' is set to 'Existing'."
433+
},
434+
"defaultValue": ""
415435
}
416436
},
417437
"variables": {
@@ -1568,6 +1588,7 @@
15681588
}
15691589
},
15701590
{
1591+
"condition": "[equals(parameters('storageAccountDeployMode'), 'New')]",
15711592
"type": "Microsoft.Storage/storageAccounts",
15721593
"name": "[variables('storageAccountName')]",
15731594
"apiVersion": "2021-06-01",
@@ -1585,7 +1606,7 @@
15851606
"sku": {
15861607
"name": "[variables('storageAccountType')]"
15871608
},
1588-
"kind": "Storage",
1609+
"kind": "StorageV2",
15891610
"tags": "[ if(contains(parameters('tagsByResource'), 'Microsoft.Storage/storageAccounts'), parameters('tagsByResource')['Microsoft.Storage/storageAccounts'], json('{}')) ]"
15901611
},
15911612
{
@@ -1676,10 +1697,7 @@
16761697
]
16771698
},
16781699
"diagnosticsProfile": {
1679-
"bootDiagnostics": {
1680-
"enabled": "true",
1681-
"storageUri": "[reference(variables('storageAccountId'), '2023-01-01').primaryEndpoints.blob]"
1682-
}
1700+
"bootDiagnostics": "[if(equals(parameters('storageAccountDeployMode'), 'None'), createObject('enabled', false()), if(equals(parameters('storageAccountDeployMode'), 'Managed'), createObject('enabled', true()), createObject('enabled', true(), 'storageUri', if(equals(parameters('storageAccountDeployMode'), 'New'), reference(variables('storageAccountId'), '2023-01-01').primaryEndpoints.blob, reference(parameters('existingStorageAccountId'), '2023-05-01').primaryEndpoints.blob))))]"
16831701
}
16841702
},
16851703
"overprovision": false

azure/templates/marketplace-ha/createUiDefinition.json

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@
935935
"label": "Availability options",
936936
"defaultValue": "Availability Set",
937937
"toolTip": "Use replicated Cluster VMs in Availability Set or Availability Zones. Note that the load balancers and their IP addresses will be zone redundant in any case.",
938-
"visible": "[contains(' australiaeast brazilsouth canadacentral centralus eastasia eastus eastus2 francecentral germanywestcentral japaneast koreacentral northeurope norwayeast southafricanorth southcentralus southeastasia swedencentral uksouth usgovvirginia westeurope westus2 westus3 switzerlandnorth qatarcentral centralindia uaenorth italynorth ', concat(' ', location(), ' '))]",
938+
"visible": "[contains(' australiaeast brazilsouth canadacentral centralus eastasia eastus eastus2 francecentral germanywestcentral japaneast koreacentral northeurope norwayeast southafricanorth southcentralus southeastasia swedencentral uksouth usgovvirginia westeurope westus2 westus3 switzerlandnorth qatarcentral centralindia uaenorth italynorth', concat(' ', location(), ' '))]",
939939
"constraints": {
940940
"allowedValues": [
941941
{
@@ -1110,7 +1110,7 @@
11101110
"name": "floatingIP",
11111111
"type": "Microsoft.Common.OptionsGroup",
11121112
"label": "Deploy the Load Balancers with floating IP",
1113-
"defaultValue": "No",
1113+
"defaultValue": "Yes",
11141114
"toolTip": "Deploy the Load Balancers with floating IP.",
11151115
"constraints": {
11161116
"allowedValues": [
@@ -1486,6 +1486,35 @@
14861486
},
14871487
"visible": "[steps('network').NSG]"
14881488
},
1489+
{
1490+
"name": "storageAccountDeployMode",
1491+
"type": "Microsoft.Common.DropDown",
1492+
"label": "Storage Account Deployment Mode",
1493+
"toolTip": "Select your preferred Storage Account deployment mode, New to a new Storage Account, Existing to an existing Storage Account, Managed to managed Storage Account, None to deploy without a Storage Account",
1494+
"defaultValue": "New",
1495+
"constraints": {
1496+
"allowedValues": [
1497+
{
1498+
"label": "New",
1499+
"value": "New"
1500+
},
1501+
{
1502+
"label": "Existing",
1503+
"value": "Existing"
1504+
},
1505+
{
1506+
"label": "Managed",
1507+
"value": "Managed"
1508+
},
1509+
{
1510+
"label": "None",
1511+
"value": "None"
1512+
}
1513+
],
1514+
"required": true
1515+
},
1516+
"visible": true
1517+
},
14891518
{
14901519
"name": "addStorageAccountIpRules",
14911520
"type": "Microsoft.Common.OptionsGroup",
@@ -1503,9 +1532,48 @@
15031532
"value": true
15041533
}
15051534
],
1506-
"required": true
1535+
"required": "[equals(steps('network').storageAccountDeployMode, 'New')]"
15071536
},
1508-
"visible": true
1537+
"visible": "[equals(steps('network').storageAccountDeployMode, 'New')]"
1538+
},
1539+
{
1540+
"name": "existingStorageAccount",
1541+
"type": "Microsoft.Solutions.ResourceSelector",
1542+
"label": "Storage Account",
1543+
"defaultValue": "null",
1544+
"toolTip": "Choose an existing Storage Account",
1545+
"resourceType": "Microsoft.Storage/storageAccounts",
1546+
"constraints": {
1547+
"required": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
1548+
},
1549+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
1550+
},
1551+
{
1552+
"name": "infoExistingStorageAccount",
1553+
"type": "Microsoft.Common.InfoBox",
1554+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]",
1555+
"options": {
1556+
"icon": "Info",
1557+
"text": "The Storage Account must allow network access from the Serial Console feature, for more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Serial Console Security</a>."
1558+
}
1559+
},
1560+
{
1561+
"name": "infoManagedStorageAccount",
1562+
"type": "Microsoft.Common.InfoBox",
1563+
"visible": "[equals(steps('network').storageAccountDeployMode, 'Managed')]",
1564+
"options": {
1565+
"icon": "Info",
1566+
"text": "Azure will use a managed Storage Account for the deployment, no additional configuration is required."
1567+
}
1568+
},
1569+
{
1570+
"name": "warningNoneStorageAccount",
1571+
"type": "Microsoft.Common.InfoBox",
1572+
"visible": "[equals(steps('network').storageAccountDeployMode, 'None')]",
1573+
"options": {
1574+
"icon": "Warning",
1575+
"text": "Please note that deploying without a Storage Account will not allow you to use the Serial Console feature. For more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Azure Serial Console</a>."
1576+
}
15091577
}
15101578
]
15111579
},
@@ -1579,7 +1647,9 @@
15791647
"deployNewNSG": "[steps('network').NSG]",
15801648
"ExistingNSG": "[steps('network').nsgSelector]",
15811649
"NewNsgName": "[steps('network').NSGName]",
1582-
"addStorageAccountIpRules": "[steps('network').addStorageAccountIpRules]",
1650+
"storageAccountDeployMode": "[steps('network').storageAccountDeployMode]",
1651+
"addStorageAccountIpRules":"[steps('network').addStorageAccountIpRules]",
1652+
"existingStorageAccountId": "[steps('network').existingStorageAccount]",
15831653
"VipsNumber": "[int(steps('network').Vips_Number)]",
15841654
"VipNames": "[concat(steps('network').VIP_Names.VIP2_Name, ',', steps('network').VIP_Names.VIP3_Name, ',', steps('network').VIP_Names.VIP4_Name, ',', steps('network').VIP_Names.VIP5_Name, ',', steps('network').VIP_Names.VIP6_Name, ',', steps('network').VIP_Names.VIP7_Name, ',', steps('network').VIP_Names.VIP8_Name, ',', steps('network').VIP_Names.VIP9_Name, ',', steps('network').VIP_Names.VIP10_Name)]",
15851655
"SerialConsolePasswordHash": "[steps('chkp-advanced').AdditionalPassword]",

0 commit comments

Comments
 (0)