azurerm_orchestrated_virtual_machine_scale_set - fix source_image_id processing #17786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proposed fix for issue #14820
As discussed in the issue, there is an issue with the azurerm_orchestrated_virtual_machine_scale_set resource, whereby the
source_image_id
attribute is not sent through to the Azure API. This is a result of an error in the expandOrchestratedSourceImageReference function. We can see on lines 1339-1341 that the function will exit before checking thesource_image_id
value if thesource_image_reference
block is empty, which it should be if asource_image_id
is provided.As mentioned, I'm not sure if the prefered fix would be to fix the new function, or simply to make a call to the pre-existing
expandSourceImageReference
like I have done in this PR. Either way, I figured opening this PR would be a good start to getting this issue resolved as it's been outstanding for 7 months.