2

I was following this documentation that indicates how to deploy a zip file to azure function apps using the azure cli: https://learn.microsoft.com/en-us/cli/azure/functionapp/deployment/source?view=azure-cli-latest#az-functionapp-deployment-source-config-zip

I logged in to azure via the command (the login was successful and it generated a json object in return)

az login

After that I ran the command to deploy zip file to the function app

az functionapp deployment source config-zip --name testmigfuncapp --resource-group g_rscgroup --src "C:\Code\Azure Functions\Proj"

In response I get

[Errno 13] Permission denied: 'C:\\Code\\Azure Functions\\Proj'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\knack\knack\cli.py", line 197, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\azure-cli-core\azure\cli\core\commands\__init__.py", line 373, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\six\six.py", line 693, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\azure-cli-core\azure\cli\core\commands\__init__.py", line 347, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\azure-cli-core\azure\cli\core\commands\__init__.py", line 182, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\azure-cli-core\azure\cli\core\__init__.py", line 440, in default_command_handler
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-jvxpk9ku\azure-cli-appservice\azure\cli\command_modules\appservice\custom.py", line 257, in enable_zip_deploy
PermissionError: [Errno 13] Permission denied: 'C:\\Code\\Azure Functions\\Proj'

I am on windows machine, running windows 10. PS: If anyone could guide me on how does Visual Studio Code deploys to function app via its function app extension, that would be great (I need to know about CLI deployment since I need to deploy from on-premises via command line since there is no visual studio code there).

0

1 Answer 1

4

I can reproduce your issue, it was caused by the --src, you missed the .zip, it should be a zip file path location like C:\Code\Azure Functions\Proj.zip, add it, then will work fine.

enter image description here enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks mate, it worked like a charm. Didn't knew this small issue could give such a vague error.
Sorry! I thought I marked this as verified, my bad.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.