question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bpossolocommented, Aug 1, 2020

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 🎉

2reactions
mikaelweavecommented, Apr 19, 2020

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zip deployment for Azure Functions - Microsoft Learn
Push deploy a . zip file to your function app by using the az functionapp deployment source config-zip command. To use this command,...
Read more >
Deploying a Python Azure function as .zip - GoDataDriven
Triggering remote build & deploy. After creating the .zip file, I deploy the example function app like this with the Azure CLI: az...
Read more >
ZIP Doesn't show in Azure Functions - Stack Overflow
I have tried the below steps to do the zip deployment of Function App using CLI: Created the .NET 6 Azure Functions locally...
Read more >
Azure DevOps Python Function App failed zip deployment
I have a Python Azure Functions app that is set to deploy automatically to an Azure App Service through an Azure DevOps pipeline....
Read more >
Developing and deploying a Python Azure Function - Medium
I have been working with C# Azure Functions for a quite a while now. ... Azure to CLI to deploy the Python function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found