BCPNFR23 - Module composition

ID: BCPNFR23 - Category: Composition

Each Bicep AVM module that lives within the Azure/bicep-registry-modules (BRM) repository in the avm directory MUST have the following directories and files:

  • /tests - (for unit tests and additional E2E/integration if required - e.g. Pester etc.)
    • /e2e - (all examples must deploy successfully - these will be used to automatically generate the examples in the README.md for the module)
  • /src - (for scripts and other files - e.g., scripts used by the template)
    • exampleFile.ps1
  • /modules - (for sub-modules only if used and NOT children of the primary resource - e.g. RBAC role assignments)
    • exampleTemplate.bicep
  • /main.bicep (AVM Module main .bicep file and entry point/orchestration module)
  • /main.json (auto generated and what is published to the MCR via BRM)
  • /version.json (BRM requirement)
  • /README.md (auto generated AVM Module documentation)
  • /CHANGELOG.md (manually maintained changelog file with one entry per published version)

Directory and File Structure Example

/ Root of Azure/bicep-registry-modules
β”‚
β”œβ”€β”€β”€avm
β”‚   β”œβ”€β”€β”€ptn
β”‚   β”‚   └───apptiervmss
β”‚   β”‚       β”‚   main.bicep
β”‚   β”‚       β”‚   main.json
β”‚   β”‚       β”‚   README.md
β”‚   β”‚       β”‚   CHANGELOG.md
β”‚   β”‚       β”‚   version.json
β”‚   β”‚       β”œβ”€β”€β”€src (optional)
β”‚   β”‚       β”‚   β”œβ”€β”€β”€Get-Cake.ps1
β”‚   β”‚       β”‚   └───Find-Waldo.ps1
β”‚   β”‚       β”œβ”€β”€β”€modules (optional)
β”‚   β”‚       β”‚   β”œβ”€β”€β”€helper.bicep
β”‚   β”‚       β”‚   └───role-assignment.bicep
β”‚   β”‚       └───tests
β”‚   β”‚           β”œβ”€β”€β”€unit (optional)
β”‚   β”‚           └───e2e
β”‚   β”‚               β”œβ”€β”€β”€defaults
β”‚   β”‚               β”œβ”€β”€β”€waf-aligned
β”‚   β”‚               └───max
β”‚   β”‚
β”‚   └───res
β”‚       └───compute
β”‚           └───virtual-machine
β”‚               β”‚   main.bicep
β”‚               β”‚   main.json
β”‚               β”‚   README.md
β”‚               β”‚   CHANGELOG.md
β”‚               β”‚   version.json
β”‚               β”œβ”€β”€β”€src (optional)
β”‚               β”‚   β”œβ”€β”€β”€Set-Bug.ps1
β”‚               β”‚   └───Invoke-Promotion.ps1
β”‚               β”œβ”€β”€β”€modules (optional)
β”‚               β”‚   β”œβ”€β”€β”€helper.bicep
β”‚               β”‚   └───role-assignment.bicep
β”‚               └───tests
β”‚                   β”œβ”€β”€β”€unit (optional)
β”‚                   └───e2e
β”‚                       β”œβ”€β”€β”€defaults
β”‚                       β”œβ”€β”€β”€waf-aligned
β”‚                       └───max
β”œβ”€β”€β”€other repo dirs...
└───other repo files...