Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.22k stars 747 forks source link

MSBuild: parent template is not rebuilt when child (module) template changes #5715

Open jackhorton opened 2 years ago

jackhorton commented 2 years ago

Bicep version 0.4.1124

Describe the bug If you have two templates parent.bicep and child.bicep where child.bicep is included as a module from parent.bicep, rebuilding templates with dotnet build will only regenerate child.json, not parent.json

Additional context I believe this was caused by #5253, FYI @stan-sz

majastrz commented 2 years ago

Yeah, we would need to an additional task to our msbuild targets to enumerate the true dependencies of any particular Bicep module. The logic for that shouldn't be too complicated, but we will need to figure out the packaging since Bicep.Core targets net6 but msbuild task currently targets netstandard2.0.

stan-sz commented 1 year ago

The load... file functions need to be considered for inputs that affect the output file.

majastrz commented 1 year ago

Agreed. For param files, references to bicep files via the using keyword should also be included.

stan-sz commented 8 months ago

Mildly related to #12956

anthony-c-martin commented 8 months ago

I added a bicep/getFileReferences method to #13051 which may also be helpful for this implementation.

MattKotsenas commented 4 months ago

+1 to this issue; just ran into this problem myself helping a teammate debug an issue.