azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az functionapp deployment source config-zip broken in 2.77.0

Open Naktibalda opened this issue 1 year ago • 10 comments

Describe the bug

Since upgrade to 2.77.0 az functionapp deployment source config-zip -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_NAME --src "./build/app.zip" command creates file containing the value of --src parameter instead of content of that file.

I confirmed that downgrading docker image to 2.76.0 solves this issue.

Related command

az functionapp deployment source config-zip

Errors

No errors

Issue script & Debug output

Command runs successfully, the value of --src parameter is not mentioned in debug output.

DEBUG: urllib3.connectionpool: [https://xxx.blob.core.windows.net:443](https://xxx.blob.core.windows.net/) "GET /function-releases?restype=container HTTP/1.1" 200 0

DEBUG: urllib3.connectionpool: [https://xxx.blob.core.windows.net:443](https://xxx.blob.core.windows.net/) "PUT /function-releases/20250902112340-725d671b-4e31-4d90-8153-b84bf3e26f6f.zip HTTP/1.1" 201 0

Expected behavior

Zip file is uploaded to storage account.

Environment Summary

azure-cli 2.77.0 core 2.77.0 telemetry 1.1.0 Dependencies: msal 1.34.0b1 azure-mgmt-resource 23.3.0

Additional context

No response

Naktibalda avatar Sep 02 '25 12:09 Naktibalda

Thank you for opening this issue, we will look into it.

yonzhan avatar Sep 02 '25 12:09 yonzhan

I have the same problem with my Azure Function App CLI deployment, the issue is pretty serious as the deployment itself was successful while the produced ZIP has invalid value as mentioned, which broke our production env for a few hours until we figured out what's happening.

dimitor115 avatar Sep 04 '25 17:09 dimitor115

What is the solution for this? I am using Azure CLI in the azure devops classic releases.

And it is not possible to downgrade the azure-cli version.

Need an urgent fix for this.

Is there any alternative or temporary solution for this?

Thanks in advance.

manasmagdum avatar Sep 10 '25 05:09 manasmagdum

I have the same problem with my Azure Function App CLI deployment, the issue is pretty serious as the deployment itself was successful while the produced ZIP has invalid value as mentioned, which broke our production env for a few hours until we figured out what's happening.

How did you fix this issue? Any solution other than downgrading version?

I cannot downgrade version as it is on Azure devops agent.

manasmagdum avatar Sep 10 '25 05:09 manasmagdum

@manasmagdum I've temporarily worked around this in ADO classic releases by putting a task in the stage that just runs this: pip install azure-cli==2.76.0 and it works for me.

hevcy avatar Sep 10 '25 09:09 hevcy

Ran into the same issue with devops pipelines running on ubuntu-latest, seems the image got updated to new version of az cli yesterday morning. Our workaround is the same for now (using a bash task in each of the relevant pipeline jobs)

tekking avatar Sep 10 '25 10:09 tekking

As a workaround, this is what we're doing in our release pipelines. We're using the Azure CLI task then we use the azure cli docker image within the Inline Script within the task:

docker run --rm \
  -v "$AZURE_CONFIG_DIR":/root/.azure \
  -v "$(System.DefaultWorkingDirectory)/_MyApp/drop":/workspace \
  -w /workspace \
  mcr.microsoft.com/azure-cli:2.76.0 \
  az functionapp deployment source config-zip \
  --name my-function \
  --resource-group my-resource-group \
  --src MyApp.zip \
  --subscription my-subscription \
  --debug

badsyntax avatar Sep 10 '25 11:09 badsyntax

I tried a workaround with the preview command: az functionapp deploy but that resulted in: <title>502 - Web server received an invalid response while acting as a gateway or proxy server.</title>

And: This API isn't available in this environment yet!

Downgrading is the only solution

If you need the downgrade script for in a dockerfile:

# Install latest azure cli
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
# Downgrade it
RUN apt-get install -y --allow-downgrades  azure-cli=2.76.0-1~bookworm

The lsb (bookworm) can be different depending on your base image.

For whoever fixes this, please make sure this is integration tested, as this caused downtime for multiple people.

Additional details:

We use a linux function app in a consumption plan with WEBSITE_RUN_FROM_PACKAGE Function runtime version: 4.1042.100.2

pregress avatar Sep 11 '25 11:09 pregress

Lost precious time on this today.... Since I was upgrading to isolated process model in an azure func, I was convinced that it's my fault....

I checked one of the zips in the func storage, container: function-releases and they are indeed invalid.. they are just text files with the value from --src parm

Got bit by this pretty hard also, luckily our function was non critical, but it still had impact on our customers. Our fix was to deploy manually using an older version of azure cli, and we will have to do that until the fix comes in hopefully in the October release via https://github.com/Azure/azure-cli/pull/32119.

I feel this case should've been treated with more urgency, I wonder how many other people have dead azure functions just sitting there without any warning that something has gone wrong...

Shane-oo avatar Oct 07 '25 01:10 Shane-oo