Separate publishing to container registries with new azd publish command - #5663
Conversation
ac3fc44 to
917e130
Compare
|
Hello, I don't know if it can be included in this PR or not but It could be great to be able to publish to another docker registry than ACR. Thanks for your work |
Thank you for the input! I'm testing this scenario out and it looks like it shouldn't be too hard to support in this PR given that azd deploy supports external registries already today. |
wbreza
left a comment
There was a problem hiding this comment.
A couple questions and issues to consider.
-
The
ServiceTargetinterface exposesPackageandDeployfunctions. Given this change we should consider addingPublishto this interface and implementing it on supported service targets like container app -
Given a new top level command we should also consider exposing new
publishproject & service hooks so users can more easily integrate with this new capability. -
Given the separation of publishing from deploy we should consider whether our default
upworkflow should still only calldeployor also includepublishas well. -
Consider adding
Publishsupport for AKS service target (future PR)
c79efb0 to
690bc1f
Compare
690bc1f to
4c53c10
Compare
weikanglim
left a comment
There was a problem hiding this comment.
I can see how the current implementation is sitting nicely.
I'm pondering about and happy to discuss with you and the rest of the team some overall design thoughts in the comments that I left.
wbreza
left a comment
There was a problem hiding this comment.
Overall this looks amazing! I only have a couple open questions around the following:
- Default overrwrite behavior? Should be true/false if the image/tag already exists?
- Just need to ensure all our e2e tests cases still work to ensure we don't have any regressions.
weikanglim
left a comment
There was a problem hiding this comment.
LGTM. Thank you @JeffreyCA for taking the time to address the comments to land this cleanly.
vhvb1989
left a comment
There was a problem hiding this comment.
LGTM.
Added a few comments. Please review.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Closes #5601
This PR introduces a separate
azd publishcommand for publishing container images to a container registry. There are also some minor changes toazd deploy.azd publishazd publishsupports these flags:--all(similar toazd deploy)--from-package(similar toazd deploy)--to- The target image in the form[registry/]repository[:tag]for the container to be publisheddocker.registry,docker.image, anddocker.tag):Other changes/notes:
The default
azd upworkflow is unchanged and will still callprovisionanddeploy, butazd upcan be customized in azure.yaml withazd publishand the same image reference would be used throughout using theserviceManageroperation result cache--from-packageis compatible with--to. So running the following command would publish the local imagetodo-nodejs-mongo-aca-web:azd-deploy-1757350123to<acr>.azurecr.io/web-override:20250922:azd publishsupports publishing to third-party container registries (likedocker.io)Only services with host type
containerappandaksare currently supported. The command succeeds with a warning on unsupported host types:Supports local and remote build
Supports
prepublishandpostpublishproject and service hooks:The
IMAGE_NAMEservice property is still set in the environment for backwards compatibility, but becausepublishis now a top level action, thedeploylogic can get the published image fromServicePublishResultinstead of reading from theIMAGE_NAMEenvironment variable.azd deployazd deploynow supports passing a fully qualified image reference (with the registry endpoint). If one is passed to--from-package, then azd skips packaging and publishing the image and directly proceeds to create the container app revision.Examples: