azure-cli: function app: Unable to upload python ZIP in Azure function using CLI

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az functionapp deployment source config-zip

root@pipejenkinstf:/test# az functionapp deployment source config-zip --resource-group myrandrg --name myuniquefunctj --src ./deploy.zip --verbose

  • Uploading ============================== 100.0% … Syncing Triggers… Unknown error command ran in 5.317 seconds. root@pipejenkinstf:/test#

Errors:

Unknown error

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az functionapp deployment source config-zip --resource-group {} --name {} --src {} --debug

Expected Behavior

Environment Summary

Linux-4.9.0-11-amd64-x86_64-with-debian-9.11
Python 3.6.5
Shell: bash

azure-cli 2.0.81 *

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 32 (9 by maintainers)

Most upvoted comments

for anyone else struggling with azure cli, the func app from Azure Functions Core Tools works for deployment.

func azure functionapp publish <app-name> --no-build --java

i ran it directly from the staging folder:

my-app
|-- src/main/java
|-- pom.xml
|-- ...
|-- target
    |-- azure-functions
        |-- my-app <-- run from inside this folder
            |-- host.json
            |-- my-app.jar
            |-- lib
            |-- my-function
                |-- function.json

alternative values for the different language runtimes:

[--csharp, --javascript, --typescript, --java, --python, --powershell]
Getting site publishing info...
Skipping build event for functions project (--no-build).
Uploading package...
Uploading 9.97 MB [###############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in OBSCURED:
   ... OBSCURED

I finally see my functions in the portal and can successfully invoke them 🎉

@anthonychu I’ve been experiencing this issue for like a year and figured with all the time at home I can finally help to fix it. 👍

Function Env: Function App I’m using - mikaeldevsite:

az functionapp create --consumption-plan-location $LOCATION \
    --runtime python --runtime-version 3.8 --functions-version 3 \
    --name $RESOURCE_NAME --storage-account $RESOURCE_NAME \
    --os-type linux

Command Producing Error: az functionapp deployment source config-zip --name $RESOURCE_NAME --src azure-web-img-dwnszr.zip (See this script for a full example)

Error Produced: Exact same as orig. post. The reason why I have dealt with this until now is because the .zip file is still created - I just need to ignore the error and all my scripts work fine.

Debug Investigations:

  • Error is throws from this line
  • Debugging into /azure-sdk-for-python/blob/master/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/operations/_web_apps_operations.py , line 24356 expects a return code of 204 from the API but 200 is returned
  • Looking at the Sync Function Triggers API reference, it seems that this API should be returning a 204 not a 200.
  • Testing out the API call in Postman had the same result - API returned a 200 vs the documented 204

Conclusion: The Sync Function Triggers API is not returning the documented return code. Do you know the best way to engage with the Azure Functions team to get this fixed @anthonychu?

Debugging screenshot Screenshot from 2020-04-18 11-46-32

Postman screenshot Screenshot from 2020-04-18 11-51-17

It’s seems that running it in a Windows host works. Hope that’s helpfull.

Thanks for the repro @mikaelweave. Super helpful. Sorry I missed it the first time. https://github.com/Azure/Azure-Functions/issues/1674

fwiw this is a show stopper…If i cant deploy i have to abandon azure functions