Skip to content

[App Service] Skip symlinks in file processing#33145

Open
danielw5 wants to merge 2 commits intoAzure:devfrom
danielw5:dev
Open

[App Service] Skip symlinks in file processing#33145
danielw5 wants to merge 2 commits intoAzure:devfrom
danielw5:dev

Conversation

@danielw5
Copy link
Copy Markdown
Member

@danielw5 danielw5 commented Apr 7, 2026

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 feature


This checklist is used to make sure that common guidelines for a pull request are followed.

danielw5 added 2 commits April 7, 2026 14:11
Skip symbolic links in file processing
@danielw5 danielw5 requested review from NoriZC and yanzhudd as code owners April 7, 2026 21:13
Copilot AI review requested due to automatic review settings April 7, 2026 21:13
@danielw5 danielw5 requested a review from teresaritorto as a code owner April 7, 2026 21:13
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@danielw5 danielw5 changed the title Skip symlinks in appservice/_create_util.py file processing [App Service] Skip symlinks in file processing Apr 7, 2026
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 7, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dir traversal.
  • Emit a log message when a symlink is skipped.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +70 to +74

if os.path.islink(absname):
logger.warning("Skipping symbolic link: %s", absname)
continue

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
absname = os.path.abspath(os.path.join(dirname, filename))

if os.path.islink(absname):
logger.warning("Skipping symbolic link: %s", absname)
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
logger.warning("Skipping symbolic link: %s", absname)
logger.info("Skipping symbolic link: %s", absname)

Copilot uses AI. Check for mistakes.
Comment on lines +71 to 76
if os.path.islink(absname):
logger.warning("Skipping symbolic link: %s", absname)
continue

arcname = absname[len(abs_src) + 1:]
zf.write(absname, arcname)
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants