Skip to content

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

Description

@zerodogg

Describe the bug

When deploying a zip file from 'az functionapp deploy' it sends the content type as application/octet-stream which causes azure to return a HTTP 415 "Unsupported Media Type". It should send application/zip.

Related command

az functionapp deploy --resource-group XXX --name XXX --src-path XXX.zip

Errors

An error occurred during deployment. Status Code: 415, Please visit …/api/deployments/latest to get more information about your deployment

Issue script & Debug output

Expected behavior

Zip gets deployed

Environment Summary

azure-cli 2.87.0

core 2.87.0
telemetry 1.1.0

Extensions:
ssh 2.0.6

Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0

Python location '/usr/local/Cellar/azure-cli/2.87.0/libexec/bin/python'
Config directory '/Users/…/.azure'
Extensions directory '/Users/…/.azure/cliextensions'

Python (Darwin) 3.13.14 (main, Jun 10 2026, 12:24:04) [Clang 17.0.0 (clang-1700.6.4.2)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

This patch fixes it:

--- a/src/azure-cli/azure/cli/command_modules/appservice/custom.py
+++ b/src/azure-cli/azure/cli/command_modules/appservice/custom.py
@@ -11361,7 +11361,10 @@ def _build_deploymentstatus_url(cmd, resource_group_name, webapp_name, slot, dep

 def _get_ondeploy_headers(params):
     if params.src_path:
-        content_type = 'application/octet-stream'
+        if params.artifact_type == "zip":
+            content_type = 'application/zip'
+        else:
+            content_type = 'application/octet-stream'
     elif params.src_url:
         content_type = 'application/json'
     else:

Metadata

Metadata

Labels

Auto-AssignAuto assign by botFunctionsaz functionappService AttentionThis issue is responsible by Azure service team.act-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions