Skip to content

[Functionapp] Fix Azure/azure-cli-extensions#10024: az functionapp deployment source config-zip: Fix zip file contents not being deployed#10025

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-az-functionapp-deployment-issue
Draft

[Functionapp] Fix Azure/azure-cli-extensions#10024: az functionapp deployment source config-zip: Fix zip file contents not being deployed#10025
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-az-functionapp-deployment-issue

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

In Azure CLI 2.77.0, upload_zip_to_storage (used for Linux consumption plan function apps) passed the --src path string directly to container_client.upload_blob() instead of reading the file first. The blob in Azure Storage ended up containing the literal path string (e.g. ./someapp.zip) rather than the zip binary — silently deploying a broken function app with no routes.

Changes

  • custom.py — Adds enable_zip_deploy_functionapp and _upload_zip_to_storage to the functionapp extension. The critical fix is in _upload_zip_to_storage, which opens the file and reads its binary content before passing it to upload_blob:

    with open(os.path.realpath(os.path.expanduser(src)), 'rb') as fs:
        zip_content = fs.read()
        blob_client = container_client.upload_blob(blob_name, zip_content, ...)

    Non-consumption plans (Premium, Dedicated) and flex function apps are handled by delegating to the core CLI's enable_zip_deploy / enable_zip_deploy_flex.

  • commands.py — Registers functionapp deployment source config-zip in the functionapp extension, overriding the buggy core CLI implementation.

  • _params.py — Adds --src, --build-remote, --timeout, --slot parameters.

  • tests/latest/test_zip_deploy_unit.py — Unit tests (ast/exec, no live Azure CLI runtime needed) asserting that _upload_zip_to_storage passes zip binary content — not the path string — to upload_blob.

  • setup.py / HISTORY.rst — Version bumped to 0.1.2.

Related command

az functionapp deployment source config-zip


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

Related command

az functionapp deployment source config-zip

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 22, 2026

Copy link
Copy Markdown
⚠️Azure CLI Extensions Breaking Change Test
⚠️functionapp
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd functionapp deployment sub group functionapp deployment added

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @copilot,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

…: Fix zip file contents not being deployed
Copilot AI changed the title [WIP] Fix az functionapp deployment source config-zip issue [Functionapp] Fix Azure/azure-cli-extensions#10024: az functionapp deployment source config-zip: Fix zip file contents not being deployed Jun 22, 2026
Copilot AI requested a review from a0x1ab June 22, 2026 23:14
@yonzhan

yonzhan commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Functionapp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants