Description
Consider https://github.com/edburns/arm-ttk/blob/master/arm-ttk/testcases/CreateUIDefinition/VMSizes-Must-Match-Template.test.ps1 .
As far as I can tell, the intent of line 22 is to define a boolean
variable depending on whether the vmSizeSelect
control is located in
"steps" or in "basics". I observe the logic currently used to make this
determination is faulty.
I submit less faulty logic is the following:
$isInSteps = $selector.JSONPath.Contains('steps[')
$lookingFor= if ($isInSteps) { "*steps(*$stepName*).$controlName*"} else {"*basics(*$($controlName)*"}
I will include two tests inputs below, both with the same
mainTemplate.json
but with different createUiDefinition.json
files.
Let's label them as vmSizeSelectInSteps
and vmSizeSelectInBasics
.
In the case of vmSizeSelectInSteps
the value of $selector.JSONPath
is
JSONPath=[0].parameters[0].steps[0].elements.type
While in the case of vmSizeSelectInBasics
the value of
$selector.JSONPath
is
JSONPath=[0].parameters[0].basics[2].elements.type
Therefore, using the occurrence of the string steps[
in JSONPath is a
better indicator of the intent than $stepName = $selector.ParentObject[0].name
Test Input
mainTemplate.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"_artifactsLocation": {
"defaultValue": "[deployment().properties.templateLink.uri]",
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
}
},
"_artifactsLocationSasToken": {
"defaultValue": "",
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured."
}
},
"enableAppGateway": {
"defaultValue": false,
"type": "bool",
"metadata": {
"description": "If true, deploy an Azure App Gateway in front of the nodes of the cluster"
}
},
"portsToExpose": {
"defaultValue": "80,443,7001-9000",
"type": "string",
"metadata": {
"description": "Ports and port ranges to expose"
}
},
"wlsDomainName": {
"defaultValue": "clusterDomain",
"type": "string",
"metadata": {
"description": "Provide Weblogic domain name"
}
},
"managedServerPrefix": {
"defaultValue": "msp",
"type": "string",
"metadata": {
"description": "Provide managed server prefix names"
}
},
"dnsLabelPrefix": {
"defaultValue": "wls",
"type": "string",
"metadata": {
"description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
}
},
"dnsNameforApplicationGateway": {
"defaultValue": "wlsclusterappgw",
"type": "string",
"metadata": {
"description": "DNS for ApplicationGateway"
}
},
"gatewayPublicIPAddressName": {
"defaultValue": "gatewayPublicIP",
"type": "string",
"metadata": {
"description": "Public IP Name for the Application Gateway"
}
},
"linuxOSVersion": {
"defaultValue": "7.4",
"type": "string",
"allowedValues": [
"7.4",
"7.3"
],
"metadata": {
"description": "The Oracle Linux version for the VM. This will pick a fully patched image of this given Oracle Linux version."
}
},
"numberOfInstances": {
"defaultValue": 2,
"type": "int",
"minValue": 2,
"maxValue": 5,
"metadata": {
"description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account"
}
},
"adminVMName": {
"defaultValue": "adminVM",
"type": "string",
"metadata": {
"description": "Admin Server hosting VM name."
}
},
"location": {
"defaultValue": "[resourceGroup().location]",
"type": "string",
"metadata": {
"description": "Location for all resources."
}
},
"vmSizeSelect": {
"defaultValue": "Standard_A3",
"type": "string",
"allowedValues": [
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4"
],
"metadata": {
"description": "Select appropriate VM Size as per requirement (Standard_A1, Standard_A2, Standard_A3, Standard_A4)"
}
},
"keyVaultName": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "KeyVault Name"
}
},
"keyVaultResourceGroup": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "Resource group name in current subscription containing the KeyVault"
}
},
"keyVaultSSLCertDataSecretName": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "The name of the secret in the specified KeyVault whose value is the SSL Certificate Data"
}
},
"keyVaultSSLCertPasswordSecretName": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "The name of the secret in the specified KeyVault whose value is the password for the corresponding SSL Certificate"
}
}
},
"variables": {
"keyVaultLinkedTemplateName": "appGatewayNestedTemplate.json",
"clusterLinkedTemplateName": "clusterTemplate.json",
"currentSubscription": "[subscription().subscriptionId]"
},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"name": "clusterLinkedTemplate",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('clusterLinkedTemplateName')))]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"_artifactsLocation": {
"value": "[parameters('_artifactsLocation')]"
},
"_artifactsLocationSasToken": {
"value": "[parameters('_artifactsLocationSasToken')]"
},
"acceptOTNLicenseAgreement": {
"value": "[parameters('acceptOTNLicenseAgreement')]"
},
"adminPasswordOrKey": {
"value": "[parameters('adminPasswordOrKey')]"
},
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
"adminVMName": {
"value": "[parameters('adminVMName')]"
},
"dnsLabelPrefix": {
"value": "[parameters('dnsLabelPrefix')]"
},
"dnsNameforApplicationGateway": {
"value": "[parameters('dnsNameforApplicationGateway')]"
},
"enableAppGateway": {
"value": "[parameters('enableAppGateway')]"
},
"gatewayPublicIPAddressName": {
"value": "[parameters('gatewayPublicIPAddressName')]"
},
"linuxOSVersion": {
"value": "[parameters('linuxOSVersion')]"
},
"location": {
"value": "[parameters('location')]"
},
"managedServerPrefix": {
"value": "[parameters('managedServerPrefix')]"
},
"numberOfInstances": {
"value": "[parameters('numberOfInstances')]"
},
"otnAccountUsername": {
"value": "[parameters('otnAccountUsername')]"
},
"otnAccountPassword": {
"value": "[parameters('otnAccountPassword')]"
},
"portsToExpose": {
"value": "[parameters('portsToExpose')]"
},
"vmSizeSelect": {
"value": "[parameters('vmSizeSelect')]"
},
"wlsDomainName": {
"value": "[parameters('wlsDomainName')]"
},
"wlsUserName": {
"value": "[parameters('wlsUserName')]"
},
"wlsPassword": {
"value": "[parameters('wlsPassword')]"
}
}
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"name": "keyVaultLinkedAppGatewayTemplate",
"condition": "[parameters('enableAppGateway')]",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('keyVaultLinkedTemplateName')))]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"appGatewaySSLCertificateData": {
"reference": {
"keyVault": {
"id": "[resourceId(variables('currentSubscription'), parameters('keyVaultResourceGroup'), 'Microsoft.KeyVault/vaults', parameters('keyVaultName'))]"
},
"secretName": "[parameters('keyVaultSSLCertDataSecretName')]"
}
},
"appGatewaySSLCertificatePassword": {
"reference": {
"keyVault": {
"id": "[resourceId(variables('currentSubscription'), parameters('keyVaultResourceGroup'), 'Microsoft.KeyVault/vaults', parameters('keyVaultName'))]"
},
"secretName": "[parameters('keyVaultSSLCertPasswordSecretName')]"
}
},
"gatewayPublicIPAddressName": {
"value": "[parameters('gatewayPublicIPAddressName')]"
},
"location": {
"value": "[parameters('location')]"
},
"managedServerPrefix": {
"value": "[parameters('managedServerPrefix')]"
},
"numberOfInstances": {
"value": "[parameters('numberOfInstances')]"
},
"wlsDomainName": {
"value": "[parameters('wlsDomainName')]"
}
}
},
"dependsOn": [
"clusterLinkedTemplate"
]
}
],
"outputs": {
"wlsDomainLocation": {
"type": "string",
"value": "[reference('clusterLinkedTemplate').outputs.wlsDomainLocation.value]"
},
"adminHostName": {
"type": "string",
"value": "[reference('clusterLinkedTemplate').outputs.adminHostName.value]"
},
"adminConsole": {
"type": "string",
"value": "[reference('clusterLinkedTemplate').outputs.adminConsole.value]"
},
"adminSecuredConsole": {
"type": "string",
"value": "[reference('clusterLinkedTemplate').outputs.adminSecuredConsole.value]"
},
"appGatewayURL": {
"type": "string",
"value": "[if(parameters('enableAppGateway'), reference('keyVaultLinkedAppGatewayTemplate').outputs.appGatewayURL.value, '')]"
}
}
}
createUiDefinition vmSizeSelectInSteps
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "dnsLabelPrefix",
"type": "Microsoft.Common.TextBox",
"label": "DNS Label Prefix",
"toolTip": "The string to prepend to the DNS label.",
"defaultValue": "wls",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,10}$",
"validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only."
}
},
{
"name": "managedServerPrefix",
"type": "Microsoft.Common.TextBox",
"label": "Managed Server Prefix",
"toolTip": "The string to prepend to the name of the managed server.",
"defaultValue": "msp",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,20}$",
"validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers only."
}
},
{
"name": "numberOfInstances",
"type": "Microsoft.Common.TextBox",
"label": "Number of VMs",
"defaultValue": "4",
"toolTip": "The number of VMs to create, with one WebLogic node per VM",
"constraints": {
"required": true,
"regex": "^(2|3|4|5)$",
"validationMessage": "Number of VMs to deploy, limit 5 since this offer is using a single storage account."
},
"visible": true
},
{
"name": "wlsDomainName",
"type": "Microsoft.Common.TextBox",
"label": "WebLogic Domain Name",
"toolTip": "The name of the WebLogic Domain to create.",
"defaultValue": "clusterDomain",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,20}$",
"validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only."
}
}
],
"steps": [
{
"name": "VirtualMachineConfig",
"label": "Virtual Machine Settings",
"subLabel": {
"preValidation": "Configure the resources and settings of the virtual machines that comprise the nodes of the WebLogic Domain. ",
"postValidation": "Done"
},
"bladeTitle": "Node Virtual Machine Settings",
"elements": [
{
"name": "vmSizeSelect",
"type": "Microsoft.Compute.SizeSelector",
"label": "Virtual machine size",
"toolTip": "The size of virtual machine to provision.",
"recommendedSizes": [
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4"
],
"osPlatform": "Linux",
"count": "1"
}
]
},
{
"name": "Credentials",
"label": "Credentials for Cluster Creation",
"subLabel": {
"preValidation": "Provide credentials Required for Cluster Creation",
"postValidation": "Done"
},
"bladeTitle": "Credentials for Cluster Creation",
"elements": [
{
"name": "acceptOTNLicenseAgreement",
"label": "Accept OTN License Agreement",
"type": "Microsoft.Common.TextBox",
"toolTip": "A value of N indicates you do not accept the OTN License Agreement. In that case the deployment will fail.",
"defaultValue": "Y",
"visible": true,
"constraints": {
"required": true,
"regex": "^[Yy]$",
"validationMessage": "The value must be Y/y to proceed with deployment."
}
},
{
"name": "adminUsername",
"type": "Microsoft.Common.TextBox",
"label": "Username for admin account of VMs",
"defaultValue": "weblogic",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": true
},
{
"name": "adminPasswordOrKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for admin account of VMs",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for admin account of VMs",
"constraints": {
"required": true,
"regex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$",
"validationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character"
},
"options": {
"hideConfirmation": false
},
"visible": true
},
{
"name": "otnAccountUsername",
"type": "Microsoft.Common.TextBox",
"label": "OTN Account Username",
"toolTip": "The username of a pre-existing OTN account.",
"constraints": {
"required": true,
"regex": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
"validationMessage": "The value must be a valid email address"
}
},
{
"name": "otnAccountPassword",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for OTN Account",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for OTN Account",
"constraints": {
"required": true,
"validationMessage": "Validation constraints for OTN accounts apply here."
},
"options": {
"hideConfirmation": false
},
"visible": true
},
{
"name": "wlsUserName",
"type": "Microsoft.Common.TextBox",
"label": "Username for WebLogic Administrator",
"defaultValue": "weblogic",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": true
},
{
"name": "wlsPassword",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for WebLogic Administrator",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for WebLogic Administrator",
"constraints": {
"required": true,
"regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$",
"validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number."
},
"options": {
"hideConfirmation": false
},
"visible": true
}
]
},
{
"name": "Network",
"label": "Network",
"subLabel": {
"preValidation": "Parameters to customzie network settings",
"postValidation": "Done"
},
"bladeTitle": "Network",
"elements": [
{
"name": "portsToExpose",
"label": "Ports and port ranges to expose (N or N-N, comma separated)",
"type": "Microsoft.Common.TextBox",
"toolTip": "Ports and port ranges to expose (N or N-N, comma separated)",
"defaultValue": "80,443,7001-9000",
"visible": true,
"constraints": {
"required": true,
"regex": "^((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]$",
"validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas"
}
}
]
}
],
"outputs": {
"acceptOTNLicenseAgreement": "[steps('Credentials').acceptOTNLicenseAgreement]",
"adminPasswordOrKey": "[steps('Credentials').adminPasswordOrKey]",
"adminUsername": "[steps('Credentials').adminUsername]",
"dnsLabelPrefix": "[basics('dnsLabelPrefix')]",
"managedServerPrefix": "[basics('managedServerPrefix')]",
"numberOfInstances": "[int(basics('numberOfInstances'))]",
"otnAccountPassword": "[steps('Credentials').otnAccountPassword]",
"otnAccountUsername": "[steps('Credentials').otnAccountUsername]",
"portsToExpose": "[steps('Network').portsToExpose]",
"vmSizeSelect": "[steps('VirtualMachineConfig').vmSizeSelect]",
"wlsDomainName": "[basics('wlsDomainName')]",
"wlsPassword": "[steps('Credentials').wlsPassword]",
"wlsUserName": "[steps('Credentials').wlsUserName]",
"Location": "[location()]"
}
}
}
createUiDefinition vmSizeSelectInBasics
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "acceptOTNLicenseAgreement",
"label": "Accept OTN License Agreement",
"type": "Microsoft.Common.TextBox",
"toolTip": "A value of N indicates you do not accept the OTN License Agreement. In that case the deployment will fail.",
"defaultValue": "Y",
"visible": true,
"constraints": {
"required": true,
"regex": "^[Yy]$",
"validationMessage": "The value must be Y/y to proceed with deployment."
}
},
{
"name": "basicsRequired",
"type": "Microsoft.Common.Section",
"label": "Credentails for Virtual Machines and WebLogic",
"elements": [
{
"name": "adminUsername",
"type": "Microsoft.Common.TextBox",
"label": "Username for admin account of VMs",
"defaultValue": "weblogic",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": true
},
{
"name": "adminPasswordOrKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for admin account of VMs",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for admin account of VMs",
"constraints": {
"required": true,
"regex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$",
"validationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character"
},
"options": {
"hideConfirmation": false
},
"visible": true
},
{
"name": "otnAccountUsername",
"type": "Microsoft.Common.TextBox",
"label": "OTN Account Username",
"toolTip": "The username of a pre-existing OTN account.",
"constraints": {
"required": true,
"regex": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
"validationMessage": "The value must be a valid email address"
}
},
{
"name": "otnAccountPassword",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for OTN Account",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for OTN Account",
"constraints": {
"required": true,
"validationMessage": "Validation constraints for OTN accounts apply here."
},
"options": {
"hideConfirmation": false
},
"visible": true
},
{
"name": "wlsUserName",
"type": "Microsoft.Common.TextBox",
"label": "Username for WebLogic Administrator",
"defaultValue": "weblogic",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": true
},
{
"name": "wlsPassword",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password for WebLogic Administrator",
"confirmPassword": "Confirm password"
},
"toolTip": "Password for WebLogic Administrator",
"constraints": {
"required": true,
"regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$",
"validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number."
},
"options": {
"hideConfirmation": false
},
"visible": true
},
{
"name": "numberOfInstances",
"type": "Microsoft.Common.TextBox",
"label": "Number of VMs",
"defaultValue": "4",
"toolTip": "The number of VMs to create, with one WebLogic node per VM",
"constraints": {
"required": true,
"regex": "^(2|3|4|5)$",
"validationMessage": "Number of VMs to deploy, limit 5 since this offer is using a single storage account."
},
"visible": true
}
],
"visible": true
},
{
"name": "basicsOptional",
"type": "Microsoft.Common.Section",
"label": "Optional Basic Configuration",
"elements": [
{
"name": "basicsOptionalAcceptDefaults",
"type": "Microsoft.Common.OptionsGroup",
"label": "Accept defaults for optional configuration?",
"defaultValue": "Yes",
"toolTip": "Select 'No' to edit optional basic configuration.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": "false"
},
{
"label": "No",
"value": "true"
}
],
"required": true
}
},
{
"name": "dnsLabelPrefix",
"type": "Microsoft.Common.TextBox",
"label": "DNS Label Prefix",
"toolTip": "The string to prepend to the DNS label.",
"defaultValue": "wls",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,10}$",
"validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only."
},
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
},
{
"name": "managedServerPrefix",
"type": "Microsoft.Common.TextBox",
"label": "Managed Server Prefix",
"toolTip": "The string to prepend to the name of the managed server.",
"defaultValue": "msp",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,20}$",
"validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers only."
},
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
},
{
"name": "wlsDomainName",
"type": "Microsoft.Common.TextBox",
"label": "WebLogic Domain Name",
"toolTip": "The name of the WebLogic Domain to create.",
"defaultValue": "clusterDomain",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{3,20}$",
"validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only."
},
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
},
{
"name": "vmSizeSelect",
"type": "Microsoft.Compute.SizeSelector",
"defaultValue": "Standard_A3",
"label": "Virtual machine size",
"toolTip": "The size of virtual machine to provision.",
"recommendedSizes": [
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4"
],
"osPlatform": "Linux",
"count": "1",
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
},
{
"name": "portsToExpose",
"label": "Ports and port ranges to expose (N or N-N, comma separated)",
"type": "Microsoft.Common.TextBox",
"toolTip": "Ports and port ranges to expose (N or N-N, comma separated)",
"defaultValue": "80,443,7001-9000",
"constraints": {
"required": true,
"regex": "^((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]$",
"validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas"
},
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
},
{
"name": "About",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "None",
"text": "Template version ${project.version}"
},
"visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]"
}
],
"visible": true
}
],
"steps": [
{
"name": "serviceIntegrations",
"type": "Microsoft.Common.Section",
"label": "Service Integrations",
"elements": [
{
"name": "connectToAGText",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "Selecting 'Yes' here will cause the template to provision an Azure Application Gateway (WAF_v2 or later SKU), a public IP, and a backend pool consisting of the worker nodes in the cluster. Further configuration may be necessary after deployment.",
"link": {
"label": "Learn more",
"uri": "https://docs.microsoft.com/en-us/azure/application-gateway/overview"
}
}
},
{
"name": "enableAppGateway",
"type": "Microsoft.Common.OptionsGroup",
"label": "Connect to Azure Application Gateway?",
"defaultValue": "No",
"toolTip": "Select 'Yes' to cause an Azure Application Gateway to be created as the load balancer for the cluster.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
],
"required": false
}
},
{
"name": "keyVaultText",
"type": "Microsoft.Common.TextBlock",
"visible": "[steps('serviceIntegrations').enableAppGateway]",
"options": {
"text": "App Gateway integration requires an SSL Certificate to enable SSL termination at the gateway. End-to-end SSL encryption is not supported by the template. The template will look for the certificate and its password in the Azure KeyVault specified here.",
"link": {
"label": "Learn more",
"uri": "https://github.com/andrewatfornax/tech-articles/blob/6985d626e9815daf63f705dbe9bd570e38cc0297/azure-app-gateway-ssl-arm-template.md"
}
}
},
{
"name": "keyVaultName",
"type": "Microsoft.Common.TextBox",
"label": "Name of the Azure KeyVault containing secrets for the Certificate for SSL Termination",
"defaultValue": "",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": "[steps('serviceIntegrations').enableAppGateway]"
},
{
"name": "keyVaultResourceGroup",
"type": "Microsoft.Common.TextBox",
"label": "Resource group name in current subscription containing the KeyVault",
"defaultValue": "",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": "[steps('serviceIntegrations').enableAppGateway]"
},
{
"name": "keyVaultSSLCertDataSecretName",
"type": "Microsoft.Common.TextBox",
"label": "The name of the secret in the specified KeyVault whose value is the SSL Certificate Data",
"defaultValue": "",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": "[steps('serviceIntegrations').enableAppGateway]"
},
{
"name": "keyVaultSSLCertPasswordSecretName",
"type": "Microsoft.Common.TextBox",
"label": "The name of the secret in the specified KeyVault whose value is the password for the corresponding SSL Certificate",
"defaultValue": "",
"toolTip": "Use only letters and numbers",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers."
},
"visible": "[steps('serviceIntegrations').enableAppGateway]"
}
],
"visible": true
}
],
"outputs": {
"Location": "[location()]",
"acceptOTNLicenseAgreement": "[basics('acceptOTNLicenseAgreement')]",
"adminPasswordOrKey": "[basics('basicsRequired').adminPasswordOrKey]",
"adminUsername": "[basics('basicsRequired').adminUsername]",
"dnsLabelPrefix": "[basics('basicsOptional').dnsLabelPrefix]",
"enableAppGateway": "[steps('serviceIntegrations').enableAppGateway]",
"keyVaultName": "[steps('serviceIntegrations').keyVaultName]",
"keyVaultResourceGroup": "[steps('serviceIntegrations').keyVaultResourceGroup]",
"keyVaultSSLCertDataSecretName": "[steps('serviceIntegrations').keyVaultSSLCertDataSecretName]",
"keyVaultSSLCertPasswordSecretName": "[steps('serviceIntegrations').keyVaultSSLCertDataSecretName]",
"managedServerPrefix": "[basics('basicsOptional').managedServerPrefix]",
"numberOfInstances": "[int(basics('basicsRequired').numberOfInstances)]",
"otnAccountPassword": "[basics('basicsRequired').otnAccountPassword]",
"otnAccountUsername": "[basics('basicsRequired').otnAccountUsername]",
"portsToExpose": "[basics('basicsOptional').portsToExpose]",
"vmSizeSelect": "[basics('basicsOptional').vmSizeSelect]",
"wlsDomainName": "[basics('basicsOptional').wlsDomainName]",
"wlsPassword": "[basics('basicsRequired').wlsPassword]",
"wlsUserName": "[basics('basicsRequired').wlsUserName]"
}
}
}