-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fixing #444: Template Output Data Types * Adding positive/negative tests * Expanding list of acceptable data type coercion functions * Adding Length to -AllowedFunctionInOutput * Adding boolean case to failure * Adding Tracing for CI/CD debugging * More tracing for debugging CI/CD * Adding -Debug support to test functions * Adding -Debug to the Outputs-Must-Be-Present-In-Template-Parameters * Updating failure case (making JSON more correct) * Fixing casing in createUiDefinition filename * Cleaning up CI/CD debugging * Outputs-Must-Be-Present-In-Template-Parameters: Switching to warning. Adding notes. * Outputs-Must-Be-Present-In-Template-Parameters: Switching to warning. Adding notes.
- Loading branch information
1 parent
fe46027
commit c899a92
Showing
6 changed files
with
197 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ts/Outputs-Must-Be-Present-In-Template-Parameters/Pass/OutputCorrectType/azureDeploy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"swarmRootdiskSize": { | ||
"type": "int", | ||
"minValue": 30, | ||
"maxValue": 2048, | ||
"defaultValue": 30, | ||
"metadata": { | ||
"description": "Please select the size of the data disk you wish to deploy (value is integer GB)." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Location for all resources." | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...uts-Must-Be-Present-In-Template-Parameters/Pass/OutputCorrectType/createUiDefinition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"$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": [], | ||
"steps": [ | ||
{ | ||
"bladeTitle": "app Configuration", | ||
"elements": [ | ||
{ | ||
"name": "deployApp", | ||
"type": "Microsoft.Common.OptionsGroup", | ||
"label": "Deploy App", | ||
"defaultValue": "true", | ||
"toolTip": "Optionally select to deploy App", | ||
"constraints": { | ||
"allowedValues": [ | ||
{ | ||
"label": "true", | ||
"value": "yes" | ||
}, | ||
{ | ||
"label": "false", | ||
"value": "no" | ||
} | ||
], | ||
"required": true | ||
} | ||
}, | ||
{ | ||
"name": "rootDiskSize", | ||
"type": "Microsoft.Common.TextBox", | ||
"label": "Swarm instance root disk size", | ||
"defaultValue": "30", | ||
"toolTip": "Provide the size of the Swarm root disk - The size (GB) of the Managed disk.", | ||
"constraints": { | ||
"required": true, | ||
"regex": "^([3-9]\\d{1}\\d*|\\d{3}\\d*)$", | ||
"validationMessage": "Value must be numeric and greater than or equal to 30" | ||
}, | ||
"visible": true | ||
} | ||
], | ||
"visible": "[equals(steps('SwarmConfig').deployApp, 'yes')]" | ||
} | ||
], | ||
"outputs": { | ||
"location": "[location()]", | ||
"swarmRootDiskSize": "[int(coalesce(steps('SwarmConfig').vmSettings.rootDiskSize, 30))]" | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../Outputs-Must-Be-Present-In-Template-Parameters/Warn/OutputIncorrectType/azureDeploy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"swarmRootdiskSize": { | ||
"type": "int", | ||
"minValue": 30, | ||
"maxValue": 2048, | ||
"defaultValue": 30, | ||
"metadata": { | ||
"description": "Please select the size of the data disk you wish to deploy (value is integer GB)." | ||
} | ||
}, | ||
"testBoolean": { | ||
"type": "bool", | ||
"defaultValue": false, | ||
"metadata":{ | ||
"description": "A Boolean Parameter" | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Location for all resources." | ||
} | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...s-Must-Be-Present-In-Template-Parameters/Warn/OutputIncorrectType/createUiDefinition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"$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": [], | ||
"steps": [ | ||
{ | ||
"name": "swarmConfig", | ||
"label": "swarmConfig", | ||
"bladeTitle": "app Configuration", | ||
"elements": [ | ||
{ | ||
"name": "deployApp", | ||
"type": "Microsoft.Common.OptionsGroup", | ||
"label": "Deploy App", | ||
"defaultValue": "true", | ||
"toolTip": "Optionally select to deploy App", | ||
"constraints": { | ||
"allowedValues": [ | ||
{ | ||
"label": "true", | ||
"value": "yes" | ||
}, | ||
{ | ||
"label": "false", | ||
"value": "no" | ||
} | ||
], | ||
"required": true | ||
} | ||
}, | ||
{ | ||
"name": "rootDiskSize", | ||
"type": "Microsoft.Common.TextBox", | ||
"label": "Swarm instance root disk size", | ||
"defaultValue": "30", | ||
"toolTip": "Provide the size of the Swarm root disk - The size (GB) of the Managed disk.", | ||
"constraints": { | ||
"required": true, | ||
"regex": "^([3-9]\\d{1}\\d*|\\d{3}\\d*)$", | ||
"validationMessage": "Value must be numeric and greater than or equal to 30" | ||
}, | ||
"visible": true | ||
} | ||
] | ||
} | ||
], | ||
"outputs": { | ||
"location": "[location()]", | ||
"swarmRootDiskSize": "[steps('SwarmConfig').vmSettings.rootDiskSize]", | ||
"testBoolean": "[int('1')]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters