Skip to content

[AppService] Fix Azure/azure-cli#33688: az functionapp deploy: Fix wrong Content-Type header for zip deployments#33689

Draft
a0x1ab with Copilot wants to merge 4 commits into
devfrom
copilot/az-functionapp-deploy-fix-content-type
Draft

[AppService] Fix Azure/azure-cli#33688: az functionapp deploy: Fix wrong Content-Type header for zip deployments#33689
a0x1ab with Copilot wants to merge 4 commits into
devfrom
copilot/az-functionapp-deploy-fix-content-type

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Related command
az functionapp deploy --resource-group <rg> --name <app> --src-path <artifact>.zip

Description
az functionapp deploy sent application/octet-stream for all local artifacts, including zip files, which can be rejected by Kudu/SCM with HTTP 415.
This change makes zip uploads use application/zip while preserving existing behavior for non-zip artifact types.

  • Header selection fix

    • Updated _get_ondeploy_headers() to branch on artifact_type when src_path is used.
    • zip now maps to Content-Type: application/zip; other local artifact types remain application/octet-stream.
    • src_url behavior is unchanged (application/json).
  • Coverage update

    • Added unit test for zip artifact header (application/zip).
    • Added unit test to verify non-zip artifact header remains application/octet-stream.
if params.src_path:
    content_type = 'application/zip' if params.artifact_type == 'zip' else 'application/octet-stream'

Testing Guide
Example command that should now send the correct media type for zip:

az functionapp deploy --resource-group <rg> --name <app> --src-path <artifact>.zip

History Notes
[AppService] az functionapp deploy: Fix wrong Content-Type header for zip deployments


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

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

Copilot AI changed the title [WIP] Fix content type for zip file deployment in az functionapp deploy [AppService] Fix Azure/azure-cli#33688: az functionapp deploy: Fix wrong Content-Type header for zip deployments Jul 1, 2026
Copilot finished work on behalf of a0x1ab July 1, 2026 08:35
Copilot AI requested a review from a0x1ab July 1, 2026 08:35

@a0x1ab a0x1ab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Automated review — CI and live-test results

Head SHA: fe8263daa6b929e225b2b6558942b165906cfe21

❌ CI check: Azure.azure-cli (Build #20260701.11 failed)

Looking at the Azure DevOps build timeline (buildId 326978), the actual root cause is:

  • Test Homebrew Formula job was canceled after exceeding the 60-minute job timeout.
  • This timeout cascaded and canceled the Bash Script step as well.
  • No other job in the pipeline reported an error (no pylint/pytest/unit-test failures were found in the timeline).

This looks like an environment/timeout flake in the Homebrew formula packaging step rather than a
failure caused by the code change itself, but please double-check that nothing in this PR (e.g. new
dependencies, changed packaging metadata) could slow down or hang the Homebrew formula build/test
step. If you can't find a relevant cause, it's worth pushing an empty/no-op commit or re-checking after
a rebase so the CI re-runs.

❌ Tester (live-test.yml on Azure/issue-sentinel)

The live-test workflow run also failed, but for an infrastructure reason unrelated to this PR's code:

gh: The 'Microsoft Open Source' enterprise forbids access via a personal access tokens (classic)
if the token's lifetime is greater than 8 days. (HTTP 403)

The workflow's azclibot-pat (stored in Key Vault azclibotfinegrainedpat) appears to be expired/rejected,
so it could not even fetch the PR JSON to determine which tests to run. This is a pipeline credential
issue on the Azure/issue-sentinel side, not something this PR can fix.

Summary

  • 92/94 checks passed; 1 failed (Azure.azure-cli, apparently a Homebrew-formula timeout), and the
    live-test tester failed due to an expired bot PAT (infra issue).
  • Please verify the PR change doesn't affect Homebrew packaging/build time, and consider triggering a
    fresh commit/rebase to get a clean CI run for the Azure.azure-cli check.

Posted by agent-assist (autonomous bug-fix pipeline).

@a0x1ab

a0x1ab commented Jul 1, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33689 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33689 (review) and pu...

Investigated both failures and confirmed they are infra flakes, not caused by this PR change.

  • Azure.azure-cli failed because Test Homebrew Formula timed out/canceled; this PR only changes AppService deploy header logic/tests and does not touch packaging/Homebrew files.
  • live-test.yml failed in Azure/issue-sentinel due a rejected/expired classic PAT (HTTP 403) while resolving PR refs.

I also reran the relevant AppService unit tests locally and pushed commit 65741d4 (no-op rerun commit) to retrigger CI on a fresh run.

Copilot AI requested a review from a0x1ab July 1, 2026 10:40
Copilot finished work on behalf of a0x1ab July 1, 2026 10:40
@yonzhan

yonzhan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

AppService

@a0x1ab a0x1ab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review summary — PR #33689

CI: ✅ All 50 checks passed.

Live-test tester: ⚠️ The live-test.yml run (run 28512989987) failed, but not due to this PR's code. The job's gh api calls failed with:

gh: The 'Microsoft Open Source' enterprise forbids access via a personal access tokens (classic) if the token's lifetime is greater than 8 days. Please adjust your token's lifetime at the following URL: https://github.com/settings/tokens/4717038685 (HTTP 403)

This is an infrastructure problem (the azclibotfinegrainedpat/azclibot-pat secret used by the tester has expired), which broke the PR-info lookup before the test-selection logic ran. The tester's own log shows it would have found no changed test files for this PR and skipped the live test neutrally otherwise.

Conclusion: No action needed from Copilot — this PR looks good on CI, and the tester failure is an unrelated pipeline/secret issue requiring maintainer attention (rotate the azclibot-pat secret), not a code fix.


Posted by agent-assist (autonomous bug-fix pipeline).

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'az functionapp deploy' with zip file sends wrong content-type

3 participants