-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #754 from psah434/master
Addressing fixes for GitHub issues 738, 753 and 745
- Loading branch information
Showing
4 changed files
with
229 additions
and
3 deletions.
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
56 changes: 56 additions & 0 deletions
56
unit-tests/Parameter-Types-Should-Be-Consistent/Pass/bicepTemplate.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,56 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.22.6.54827", | ||
"templateHash": "2557909781805504768" | ||
} | ||
}, | ||
"parameters": { | ||
"choice": { | ||
"type": "bool" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2022-09-01", | ||
"name": "module1", | ||
"location": "[deployment().location]", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"intext": "[if(parameters('choice'), createObject('value', 'foo'), createObject('value', 'bar'))]" | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.22.6.54827", | ||
"templateHash": "10164220933236466129" | ||
} | ||
}, | ||
"parameters": { | ||
"intext": { | ||
"type": "string" | ||
} | ||
}, | ||
"resources": [], | ||
"outputs": { | ||
"outtext": { | ||
"type": "string", | ||
"value": "[parameters('intext')]" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
63 changes: 63 additions & 0 deletions
63
unit-tests/Parameter-Types-Should-Be-Consistent/Pass/innerParamArrayBicepTemplate.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,63 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.13.1.58284", | ||
"templateHash": "6364080903705651062" | ||
} | ||
}, | ||
"parameters": { | ||
"textParam2": { | ||
"type": "string", | ||
"defaultValue": "container2" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2020-10-01", | ||
"name": "mod1", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"arrayParam": { | ||
"value": [ | ||
"first", | ||
"[parameters('textParam2')]", | ||
"last" | ||
] | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.13.1.58284", | ||
"templateHash": "279482116342234053" | ||
} | ||
}, | ||
"parameters": { | ||
"arrayParam": { | ||
"type": "array", | ||
"defaultValue": [] | ||
} | ||
}, | ||
"resources": [], | ||
"outputs": { | ||
"outArray": { | ||
"type": "array", | ||
"value": "[parameters('arrayParam')]" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
99 changes: 99 additions & 0 deletions
99
unit-tests/Parameter-Types-Should-Be-Consistent/Pass/twoModuleBicepTemplate.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,99 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.22.6.54827", | ||
"templateHash": "12026618333363551042" | ||
} | ||
}, | ||
"parameters": { | ||
"input": { | ||
"type": "object" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2022-09-01", | ||
"name": "[parameters('input').module_one]", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"intext": { | ||
"value": "hello" | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.22.6.54827", | ||
"templateHash": "15717468013965412695" | ||
} | ||
}, | ||
"parameters": { | ||
"intext": { | ||
"type": "string" | ||
} | ||
}, | ||
"resources": [], | ||
"outputs": { | ||
"outtext": { | ||
"type": "string", | ||
"value": "[parameters('intext')]" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2022-09-01", | ||
"name": "moduleTwo", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"intext": { | ||
"value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('input').module_one), '2022-09-01').outputs.outtext.value]" | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.22.6.54827", | ||
"templateHash": "15717468013965412695" | ||
} | ||
}, | ||
"parameters": { | ||
"intext": { | ||
"type": "string" | ||
} | ||
}, | ||
"resources": [], | ||
"outputs": { | ||
"outtext": { | ||
"type": "string", | ||
"value": "[parameters('intext')]" | ||
} | ||
} | ||
} | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Resources/deployments', parameters('input').module_one)]" | ||
] | ||
} | ||
] | ||
} |