Closed shaneholder closed 3 months ago
Hi @shaneholder this is by design in Azure, and for sorting the version by version style, sort_versions_by_semver
needs to be set to true
, otherwise the version will be sorted by string order like you see in the az sig
command where .9
is bigger than .10
.
Thank you for taking the time to raise this! I am going to close this with @myc2h6o‘s response as an answer. If you have future questions, I suggest using the Community Resources, such as the Azure Provider forum.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Terraform Version
1.3.9
AzureRM Provider Version
3.47.0
Affected Resource(s)/Data Source(s)
azurerm_data_azurerm_shared_image_version
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The code comment at: https://github.com/hashicorp/terraform-provider-azurerm/blob/dd83ed7197a956fe8dac350cd40d43b0bd621d4c/internal/services/compute/shared_image_version_data_source.go#L187 seems to be somewhat incorrect in that it states that the last image in the list is the latest version, however it appears that the default ordering of images is by string order so 2 will come after 10. See the output of az command below and note the published time as well versions. I was using the latest tag and it was pulling the 2.0.9 image referenced below. Setting the sort_versions_by_semver yields the expected result however not setting that could return unexpected images.
Actual Behaviour
Unexpected image version returned.
Steps to Reproduce
Important Factoids
No response
References
No response