Skip to content

Instantly share code, notes, and snippets.

@dhrp
Last active July 4, 2018 08:09
Show Gist options
  • Save dhrp/90cb36b41aac7d18a87b093c77bff9c1 to your computer and use it in GitHub Desktop.
Save dhrp/90cb36b41aac7d18a87b093c77bff9c1 to your computer and use it in GitHub Desktop.
createuidefinition
{
"handler": "Microsoft.Compute.MultiVm",
"version": "0.0.1-preview",
"parameters": {
"basics": [
{
"name": "adminUsername",
"type": "Microsoft.Compute.UserNameTextBox",
"label": "VM username",
"toolTip": "Administrative username for the virtual machines.",
"osPlatform": "Linux",
"constraints": {
"required": true
}
},
{
"name": "adminCredentials",
"type": "Microsoft.Compute.CredentialsCombo",
"label": {
"authenticationType": "Authentication type",
"password": "Password",
"confirmPassword": "Confirm password",
"sshPublicKey": "SSH public key"
},
"constraints": {
"required": true
},
"options": {
"hideConfirmation": false
},
"osPlatform": "Linux"
},
{
"name": "resourceNamePrefix",
"type": "Microsoft.Common.TextBox",
"label": "Resource name prefix",
"toolTip": "String used as prefix for some resources.",
"constraints": {
"required": true,
"regex": "^[a-z][a-z0-9-]{1,3}$",
"validationMessage": "Resource prefix must be between 2 to 4 characters long without whitespace, must begin with a lowercase letter, and can contain only numbers and lowercase letters."
}
}
],
"steps": [
{
"name": "deploymentDetails",
"label": "Deployment Details",
"subLabel": {
"preValidation": "Required",
"postValidation": "Done"
},
"bladeTitle": "Deployment Details",
"elements": [
{
"name": "publicIP",
"type": "Microsoft.Network.PublicIpAddressCombo",
"label": {
"publicIpAddress": "Public IP address",
"domainNameLabel": "Domain Name prefix"
},
"defaultValue": {
"publicIpAddressName": "my-pub-ip"
},
"options": {
"hideNone": true
}
},
{
"name": "virtualNetwork",
"type": "Microsoft.Network.VirtualNetworkCombo",
"label": {
"virtualNetwork": "Virtual network",
"subnets": "Subnets"
},
"toolTip": {
"virtualNetwork": "Virtual Network Name",
"subnets": "Subnet for the application"
},
"defaultValue": {
"name": "app-vnet",
"addressPrefixSize": "/22"
},
"constraints": {
"minAddressPrefixSize": "/22"
},
"subnets": {
"subnet1": {
"label": "Subnet name",
"defaultValue": {
"name": "app-subnet",
"addressPrefixSize": "/24"
},
"constraints": {
"minAddressPrefixSize": "/24",
"minAddressCount": 12,
"requireContiguousAddresses": false
}
}
}
}
]
}
],
"outputs": {
"adminUsername": "[basics('adminUsername')]",
"authenticationType": "[basics('adminCredentials').authenticationType]",
"adminPassword": "[basics('adminCredentials').password]",
"adminSSHKey": "[basics('adminCredentials').sshPublicKey]",
"resourceNamePrefix": "[basics('resourceNamePrefix')]",
"publicIPName": "[steps('deploymentDetails').publicIP.name]",
"publicIPDomainNameLabel": "[steps('deploymentDetails').publicIP.domainNameLabel]",
"subnetName": "[steps('deploymentDetails').virtualNetwork.subnets.subnet1.name]",
"subnetAddressPrefix": "[steps('deploymentDetails').virtualNetwork.subnets.subnet1.addressPrefix]",
"vNetAddressPrefix": "[steps('deploymentDetails').virtualNetwork.addressPrefix]",
"virtualNetworkName": "[steps('deploymentDetails').virtualNetwork.name]",
"vNetRgName": "[steps('deploymentDetails').virtualNetwork.resourceGroup]",
"virtualNetworkNewOrExisting": "[steps('deploymentDetails').virtualNetwork.newOrExisting]",
"location": "[location()]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment