Creating Template3 by Defining Bicep Modules That Reuse Logic from Template1 and Template2
Short answer
C Bicep modules reference other templates as reusable building blocks, so Template3 must define modules for Template1 and Template2 before wiring their inputs.
Question
Key Takeaways
Bicep modules are the unit of reusable logic across templates, so Template3 must first declare modules that reference Template1 and Template2 before those modules can be instantiated with parameters and consumed as building blocks.
Two Bicep templates, Template1 and Template2, deploy a virtual machine and a website respectively, and a third template named Template3 must reuse logic from both. Reuse across templates in Bicep is achieved through a specific construct that has to exist before anything can reference it.
Common mistake: Starting with parameters, outputs, or a resources block. Those are the ordinary contents of any template, but none of them create a reusable reference to another template, so Template3 would duplicate logic rather than reuse it.
Expert Analysis
Why the Answer Is Correct
The requirement is that Template3 reuses logic from Template1 and Template2, and Bicep provides a specific construct for composing templates: modules. A module references another Bicep or ARM template as a callable building block, exposing its parameters and outputs so the calling template can wire them together. Because a module reference must exist before it can be used, the modules definition is the first thing to declare in Template3. The vote was unanimous at 100 for C. p2006 supplied the authoritative Microsoft Learn page on Bicep modules, and Mattt drew the right analogy by noting that this is the same modular reuse pattern as Terraform modules, which confirms the concept is about composition rather than about any single template section.
Why the Other Options Are Wrong
Parameters (D) are inputs passed into a template, and declaring them says nothing about pulling in other templates, so a Template3 with only parameters would still have to duplicate the VM and website logic. Outputs (A) are the values a template exports to its caller, which is a data flow out of the template rather than a mechanism for composing templates, and in Bicep outputs cannot be declared at the top level in a way that constitutes reuse. The resources block (B) declares the actual infrastructure items a template deploys, so using it in Template3 would mean writing the virtual machine and website again inline, which is duplication rather than the reuse the question asks for.
Community Comment Notes
The community was unanimous at 100 for C, and both substance comments identify modules as the reuse construct. p2006 linked the official Bicep modules documentation, which is the verifiable basis for the answer. Mattt's comment adds the useful framing that modules are to Bicep what modules are to Terraform, which is exactly the right mental model for understanding why modules must be defined before use. The absence of dissent reflects that the other three options are familiar template sections that simply do not perform cross-template composition.
Official Reference
https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules
This link opens the official vendor documentation in a new tab.
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 3 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 3
-
p2006 👍 1 Answered Chttps://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules
-
Mattt 👍 1 Answered CJust like Terraform we should define modules to make the code reusable
-
uncledana 👍 2C is answer
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AZ-400 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AZ-400 Practice Test →