Skip to content

Instantly share code, notes, and snippets.

@anthony-c-martin
Created April 1, 2021 23:08
Show Gist options
  • Save anthony-c-martin/19955f90014ccfd042ad98a9ce03d642 to your computer and use it in GitHub Desktop.
Save anthony-c-martin/19955f90014ccfd042ad98a9ce03d642 to your computer and use it in GitHub Desktop.
Bicep Module Example
param inputA string
module mymod './module.bicep' = {
name: 'mymod'
params: {
inputB: inputA
}
}
output outputA string = mymod.outputs.outputB
{
"$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"
}
}
}
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