-
-
Save johnlokerse/02e8de0a4891e54b067db0cf5475b046 to your computer and use it in GitHub Desktop.
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", | |
"metadata": { | |
"_generator": { | |
"name": "bicep", | |
"version": "0.13.1.58284", | |
"templateHash": "9985937893859479304" | |
} | |
}, | |
"parameters": { | |
"parDeployModuleB": { | |
"type": "bool", | |
"defaultValue": false | |
} | |
}, | |
"resources": [ | |
{ | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2020-10-01", | |
"name": "deploy-module-a", | |
"properties": { | |
"expressionEvaluationOptions": { | |
"scope": "inner" | |
}, | |
"mode": "Incremental", | |
"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": "2926398884629873820" | |
} | |
}, | |
"resources": [], | |
"outputs": { | |
"outModuleA": { | |
"type": "string", | |
"value": "This is ModuleA" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"condition": "[parameters('parDeployModuleB')]", | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2020-10-01", | |
"name": "[format('deploy-module-b-{0}', uniqueString('deploy-module-a'))]", | |
"properties": { | |
"expressionEvaluationOptions": { | |
"scope": "inner" | |
}, | |
"mode": "Incremental", | |
"parameters": { | |
"parUseModuleAOutputs": { | |
"value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy-module-a'), '2020-10-01').outputs.outModuleA.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.13.1.58284", | |
"templateHash": "568384349326341996" | |
} | |
}, | |
"parameters": { | |
"parUseModuleAOutputs": { | |
"type": "string" | |
} | |
}, | |
"resources": [], | |
"outputs": { | |
"outModuleB": { | |
"type": "string", | |
"value": "This is ModuleB" | |
} | |
} | |
} | |
}, | |
"dependsOn": [ | |
"[resourceId('Microsoft.Resources/deployments', 'deploy-module-a')]" | |
] | |
}, | |
{ | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2020-10-01", | |
"name": "[format('deploy-module-c-{0}', uniqueString(format('deploy-module-b-{0}', uniqueString('deploy-module-a'))))]", | |
"properties": { | |
"expressionEvaluationOptions": { | |
"scope": "inner" | |
}, | |
"mode": "Incremental", | |
"parameters": { | |
"parUseModuleBOutputs": { | |
"value": "[reference(resourceId('Microsoft.Resources/deployments', format('deploy-module-b-{0}', uniqueString('deploy-module-a'))), '2020-10-01').outputs.outModuleB.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.13.1.58284", | |
"templateHash": "10852055452268311390" | |
} | |
}, | |
"parameters": { | |
"parUseModuleBOutputs": { | |
"type": "string" | |
} | |
}, | |
"resources": [], | |
"outputs": { | |
"outModuleC": { | |
"type": "string", | |
"value": "This is ModuleC" | |
} | |
} | |
} | |
}, | |
"dependsOn": [ | |
"[resourceId('Microsoft.Resources/deployments', format('deploy-module-b-{0}', uniqueString('deploy-module-a')))]" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment