Created
April 1, 2021 23:08
-
-
Save anthony-c-martin/19955f90014ccfd042ad98a9ce03d642 to your computer and use it in GitHub Desktop.
Bicep Module Example
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
param inputA string | |
module mymod './module.bicep' = { | |
name: 'mymod' | |
params: { | |
inputB: inputA | |
} | |
} | |
output outputA string = mymod.outputs.outputB |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"inputA": { | |
"type": "string" | |
} | |
}, | |
"functions": [], | |
"resources": [ | |
{ | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2019-10-01", | |
"name": "mymod", | |
"properties": { | |
"expressionEvaluationOptions": { | |
"scope": "inner" | |
}, | |
"mode": "Incremental", | |
"parameters": { | |
"inputB": { | |
"value": "[parameters('inputA')]" | |
} | |
}, | |
"template": { | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"inputB": { | |
"type": "string" | |
} | |
}, | |
"functions": [], | |
"resources": [], | |
"outputs": { | |
"outputB": { | |
"type": "string", | |
"value": "[parameters('inputB')]" | |
} | |
} | |
} | |
} | |
} | |
], | |
"outputs": { | |
"outputA": { | |
"type": "string", | |
"value": "[reference(resourceId('Microsoft.Resources/deployments', 'mymod'), '2019-10-01').outputs.outputB.value]" | |
} | |
}, | |
"metadata": { | |
"_generator": { | |
"name": "bicep", | |
"version": "0.3.126.58533", | |
"templateHash": "18203976961200866954" | |
} | |
} | |
} |
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
param inputB string | |
output outputB string = inputB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment