Bicep doesn't support loading all config files in a directory even if all filenames are hardcoded in a constant array.
- Azure/bicep#3607 - for each file in a directory
- Azure/bicep#3816 - loadTextContent() - support variable or parameter as input
A workaround for this is would be to generate a .bicep
file that calls loadTextContent
multiple times instead of in a loop. This can be done using T4 Text Templates
T4.Build
nuget package contains MSBuild logic to generate the .bicep file and can be referenced in a .csproj
that compiles the bicep files.
<PackageReference Include="T4.Build" Version="0.2.4" PrivateAssets="All" />
Note: this works on Windows only