Azure / Azure/azure-cli

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

Open
#33,688 2 comments 1 reaction 5 assignees Claimed by @a0x1ab View on GitHub
act-observability-squad Auto-Assign bug customer-reported Functions Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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:

```patch
--- 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:
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.