[App Service] Skip symlinks in file processing#33145
[App Service] Skip symlinks in file processing#33145
Conversation
Skip symbolic links in file processing
Skip symbolic links
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR updates App Service’s directory-to-zip packaging logic to avoid including symbolic links when building deployment ZIPs (used by flows like webapp up).
Changes:
- Skip symlinked files during
zip_contents_from_dirtraversal. - Emit a log message when a symlink is skipped.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if os.path.islink(absname): | ||
| logger.warning("Skipping symbolic link: %s", absname) | ||
| continue | ||
|
|
There was a problem hiding this comment.
Lines 70 and 74 are blank but contain indentation whitespace. Please remove trailing whitespace on blank lines to avoid lint/style failures and unnecessary diff noise.
| if os.path.islink(absname): | |
| logger.warning("Skipping symbolic link: %s", absname) | |
| continue | |
| if os.path.islink(absname): | |
| logger.warning("Skipping symbolic link: %s", absname) | |
| continue |
| absname = os.path.abspath(os.path.join(dirname, filename)) | ||
|
|
||
| if os.path.islink(absname): | ||
| logger.warning("Skipping symbolic link: %s", absname) |
There was a problem hiding this comment.
This path is being skipped intentionally, but it's logged at WARNING level. In the same function, other intentionally skipped content (e.g., .env) is logged at INFO; consider using INFO (or DEBUG) here as well to avoid alarming/noisy warnings during normal deployments.
| logger.warning("Skipping symbolic link: %s", absname) | |
| logger.info("Skipping symbolic link: %s", absname) |
| if os.path.islink(absname): | ||
| logger.warning("Skipping symbolic link: %s", absname) | ||
| continue | ||
|
|
||
| arcname = absname[len(abs_src) + 1:] | ||
| zf.write(absname, arcname) |
There was a problem hiding this comment.
The new symlink-skipping behavior is user-visible for webapp up packaging (symlinked files will no longer be included). Please add/adjust a test to cover this case (e.g., create a temp dir with a symlink and assert it is excluded from the produced zip) to prevent regressions across platforms.
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.