-
Notifications
You must be signed in to change notification settings - Fork 236
Fix: AZD should not delete user-provided packages when using --from-package #5445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
…ackage - Add IsTemporary field to ServicePackageResult to track whether packages should be cleaned up - Update deploy command to mark user-provided packages (--from-package) as non-temporary - Update AppService and FunctionApp targets to only delete packages when IsTemporary=true - Update framework services that create temp directories to mark packages as temporary - Add comprehensive tests to verify package cleanup behavior Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
azd deploy --from-package
/azp run azure-dev - cli |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Based on feedback from @weikanglim, implement cleaner separation of concerns: - Remove IsTemporary field from ServicePackageResult - Remove package cleanup from AppService/FunctionApp Deploy methods - Handle cleanup in deploy.go command where package creation context is known - Only clean up packages created by Package() method, preserve user-provided packages - Add test to verify correct cleanup behavior This approach is cleaner because the deploy command, which knows whether it created a temporary package or the user provided one via --from-package, handles cleanup instead of passing metadata through the ServicePackageResult. Co-authored-by: weikanglim <2322434+weikanglim@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Problem
AZD was unconditionally deleting packages after deployment, including user-provided packages when using the
--from-package
flag. This broke user expectations as they don't expect their own files to be deleted.The issue was in
service_target_appservice.go
line 84 andservice_target_functionapp.go
line 86 where:This line always deleted the package, regardless of whether AZD created it or the user provided it.
Solution
Added an
IsTemporary
field toServicePackageResult
to track whether packages should be cleaned up after deployment:--from-package
): marked asIsTemporary: false
IsTemporary: true
Changes Made
IsTemporary bool
field--from-package
is used, packages are marked as non-temporaryIsTemporary
is trueExample
Before this fix:
After this fix:
While AZD-created temporary packages are still properly cleaned up to avoid disk space issues.
Fixes #5444.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms
downloads.bicep.azure.com
/tmp/go-build2309065558/b906/bicep.test -test.testlogfile=/tmp/go-build2309065558/b906/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.short=true
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.