2018-02-02 18:57:19 -08:00

175 lines
6.0 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Compute.MultiVm",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "vmName",
"type": "Microsoft.Common.TextBox",
"label": "Name",
"defaultValue": "Terraform",
"toolTip": "",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,54}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-54 characters long."
},
"visible": true
},
{
"name": "userName",
"type": "Microsoft.Compute.UserNameTextBox",
"label": "User name",
"defaultValue": "",
"toolTip": "",
"constraints": {
"required": true
},
"osPlatform": "Linux",
"visible": true
},
{
"name": "authType",
"type": "Microsoft.Compute.CredentialsCombo",
"label": {
"authenticationType": "Authentication type",
"password": "Password",
"confirmPassword": "Confirm password",
"sshPublicKey": "SSH public key"
},
"toolTip": {
"authenticationType": "",
"password": "",
"sshPublicKey": ""
},
"constraints": {
"required": true,
"customPasswordRegex": "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d@#\\$%\\^&\\*-_!+=\\[\\]\\{\\}\\|\\\\:',\\.\\?\\/`~\"\\(\\);]{8,}$",
"customValidationMessage": "The password must contain at least 8 characters, with at least 1 letter and 1 number. Alphanumerical (@#$%^&*-_!+=[]{}|\\:',.?/`~\"();)and special characters are allowed"
},
"options": {
"hideConfirmation": false,
"hidePassword": false
},
"osPlatform": "Linux",
"visible": true
}
],
"steps": [
{
"name": "firstStep",
"label": "Virtual Machine Settings",
"bladeTitle": "Virtual Machine Settings",
"subLabel": {
"preValidation": "",
"postValidation": "Done"
},
"elements": [
{
"name": "vmSize",
"type": "Microsoft.Compute.SizeSelector",
"label": "Size",
"toolTip": "",
"recommendedSizes": [
"Standard_DS2_v2",
"Standard_DS1_v2",
"Standard_DS11_v2"
],
"osPlatform": "Linux",
"count": 1,
"visible": true
},
{
"name": "vmDiskType",
"type": "Microsoft.Common.OptionsGroup",
"label": "VM disk type",
"defaultValue": "SSD",
"toolTip": "Premium disks (SSD) are backed by solid state drives and offer consistent, low-latency performance. They provide the best balance between price and performance, and are ideal for I/O-intensive applications and production workloads. Standard disks (HDD) are backed by magnetic drives and are preferable for applications where data is accessed infrequently.",
"constraints": {
"allowedValues": [
{
"label": "SSD",
"value": "Premium_LRS"
},
{
"label": "HDD",
"value": "Standard_LRS"
}
]
},
"visible": true
},
{
"name": "sptype",
"type": "Microsoft.Common.DropDown",
"label": "Service Principal Integration",
"defaultValue": "Auto(MSI)",
"toolTip": "The service pricipal will be added into Terraform as a credential for authenticating with Azure. 'Auto' means that the principal will be created by MSI (Managed Service Identity). 'Manual' means the principal should be created by user and be filled in below.",
"constraints": {
"allowedValues": [
{
"label": "Auto(MSI)",
"value": "msi"
},
{
"label": "Manual",
"value": "manual"
}
]
},
"visible": true
},
{
"name": "spSection",
"type": "Microsoft.Common.Section",
"label": "Service Principal",
"elements": [
{
"name": "principalId",
"type": "Microsoft.Common.TextBox",
"label": "Application ID",
"defaultValue": "",
"toolTip": "",
"constraints": {
"required": true,
"regex": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"validationMessage": "Must be a valid UUID."
},
"visible": true
},
{
"name": "spsecret",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password":"Secret",
"confirmPassword": ""
},
"toolTip": "",
"options": {
"hideConfirmation": true
},
"visible": true
}
],
"visible": "[equals(steps('firstStep').sptype,'manual')]"
}
]
}
],
"outputs": {
"adminPassword": "[basics('authType').password]",
"adminSSHPublicKey": "[basics('authType').sshPublicKey]",
"adminUserName": "[basics('userName')]",
"authenticationType": "[basics('authType').authenticationType]",
"storageAccountType": "[steps('firstStep').vmDiskType]",
"vmName": "[basics('vmName')]",
"vmSize": "[steps('firstStep').vmSize]",
"location": "[location()]",
"spType": "[steps('firstStep').sptype]",
"principalId": "[steps('firstStep').spSection.principalId]",
"spSecret": "[steps('firstStep').spSection.spsecret]"
}
}
}