I have the repositories in my Azure Container Registry
- myregistry.azurecr.io/bicep/myappmodule:v1.0.25798
- myregistry.azurecr.io/bicep/myappmodule:v1.0.25799
I would like to reference the latest module by the Major Version (v1) in an external bicep file. So in this case the module with version v1.0.25799 should be used.
main.bicep:
...
module appService 'br:myregistry.azurecr.io/bicep/myappmodule:v1' = {
name: 'appService'
params: {
...
}
}
...
Is there a way to get the latest repository Version?
I tried without success:
- br:myregistry.azurecr.io/bicep/myappmodule:v1.*
- br:myregistry.azurecr.io/bicep/myappmodule:v1*
- br:myregistry.azurecr.io/bicep/myappmodule:v1:latest
- br:myregistry.azurecr.io/bicep/myappmodule:latest
2
Answers
Bottom line why this isn't possible at the moment: https://github.com/Azure/bicep/issues/4186#issuecomment-907600100
There some interesting complexities if we supported version ranges rather than single versions:
(Response on my idea request in GitHub: https://github.com/Azure/bicep/discussions/7043#discussioncomment-2978469)
Tested in my enviorment and found that you can not use like below format to get that latest images from container registry. You have to use the full image name with tag to use thelatest/spefic image.
Pushed two images to ACR with simillar name ie you are using and for example trying to create a container instance from that images(resides in container registry)
Getting an error since the image is trying to pull to create a container instance doesn’t exist with that name.
Tried with the full name as it is in container registry it works fine.
would suggest you please use below format as it is pushed to conatainer registry.