You have an Azure subscription and two Bicep templates (Template1 and Template2) that deploy a virtual machine and a website. You will create a third template (Template3) that reuses logic from Template1 and Template2. What should you define first?
Choose an answer
Tap an option to check your answer.
Correct answer: Modules.
Why this is the answer
You should define Modules first. Bicep modules allow you to encapsulate and reuse Bicep code across different templates. By defining Template1 and Template2 as modules, Template3 can then reference and deploy the resources defined within them without duplicating code. This promotes reusability and maintainability. Outputs are used to return values from a Bicep deployment, not to encapsulate reusable logic. Resources are the actual Azure components being deployed, but simply defining them doesn't enable reuse across templates in the way modules do. Parameters are used to provide input values to a Bicep template or module, but they don't define reusable blocks of code themselves.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed