未使用Azure CLI部署Azure函数

mbjcgjjk  于 2023-08-07  发布在  其他
关注(0)|答案(1)|浏览(93)

我在bash和powershell中尝试了下面的命令,得到了同样的错误,为什么它会查看/home/radiumball??
在Linux虚拟机中,事实上zip文件被放置在确切的位置,但仍然找不到文件!

az functionapp deployment source config-zip -g preprod -n icx-preprod-error-mail --src C:/build_artifacts/data_collection.zip

Getting scm site credentials for zip deployment
The command failed with an unexpected error. Here is the traceback:
[Errno 2] No such file or directory: '/home/radiumball/C:/build_artifacts/data_collection.zip'
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 580, in enable_zip_deploy_functionapp
    return enable_zip_deploy(cmd, resource_group_name, name, src, timeout, slot)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 607, in enable_zip_deploy
    with open(os.path.realpath(os.path.expanduser(src)), 'rb') as fs:
FileNotFoundError: [Errno 2] No such file or directory: '/home/radiumball/C:/build_artifacts/data_collection.zip'

字符串
更新尝试将SCM_DO_BUILD_DURING_DEPLOYMENT设置为true,但仍然无法工作!x1c 0d1x的数据

1hdlvixo

1hdlvixo1#

按照以下步骤使用Azure CLI将函数部署到Azure:

打开命令提示符=>导航到您的函数项目(.zip)可用的文件夹路径:


的数据
在部署函数之前,请转到portal中的函数应用=>在Settings=>Configuration=>Application Settings中添加应用设置SCM_DO_BUILD_DURING_DEPLOYMENT=true

运行以下命令:

    1. az登录 *


2.az functionapp deployment source config-zip -g <resource_group_name> -n <function_app_name> --src <your_function_project_name>`

字符串


相关问题