简体   繁体   English

从未在函数下列出的 cli 发布到应用程序的 Azure 函数

[英]Azure function published to app from cli not listed under functions

I've the following directory structure for an Azure function app:我的 Azure 函数应用程序具有以下目录结构:

    .
    |-test
    |-TriggerTrainingApp
        -host.json
    |---azure_ws
    |---test_func
        -__init__.py
        -function.json
        -requirements.json
        -local.settings.json

I created a function app using the following command from inside TriggerTrainingApp directory using the cmd:我使用 cmd 从TriggerTrainingApp目录中使用以下命令创建了一个函数应用程序:

az functionapp create --consumption-plan-location eastus --runtime python --runtime-version 3.9 --functions-version 4 --name <APP_NAME> --os-type linux --storage-account <STORAGE_ACCOUNT> --resource-group <resource_group>

It was created as expected --verified on ui.它是按预期创建的——已在 ui 上验证。 Then I tried to publish the function by cd into test_func and running the cmd:然后我尝试通过 cd 将函数发布到test_func并运行 cmd:

func azure functionapp publish TriggerTrainingApp

The logs say the command ran succesfully but when I run func azure functionapp list-functions TriggerTrainingApp , it doesn't list any functions.日志显示命令运行成功,但是当我运行func azure functionapp list-functions TriggerTrainingApp时,它没有列出任何函数。 The output is simply:输出很简单:

Functions in TriggerTrainingApp:

The files inside test_func are now available under the function app`s app files on the ui. test_func中的文件现在可以在 ui 上的函数应用程序的应用程序文件下找到。 What am I doing wrong?我究竟做错了什么? How do I push these files to a new function under TriggerTrainingApp?如何将这些文件推送到 TriggerTrainingApp 下的新功能?

az functionapp config appsettings set --name MyFunctionApp --resource-group MyResourceGroup --settings "SCM_DO_BUILD_DURING_DEPLOYMENT=true"
  • You have to add this setting to the Azure Function App Configuration Menu before publishing any functions to it.在向其发布任何函数之前,您必须将此设置添加到Azure Function App 配置菜单
  • After updating the above config setting, publish the functions and you'll be able to see the functions.更新上述配置设置后,发布功能,您将能够看到功能。

On my research, I found a similar issue-resolution given by @ HariKrishna such as Functions are empty after deploying the Azure Function Project using command line, but the above config setting is updated using the portal in the above-mentioned solution.在我的研究中,我发现@HariKrishna给出了类似的问题解决方案,例如使用命令行部署 Azure Function Project 后 Functions 为空,但上述配置设置是使用上述解决方案中的门户更新的。 This can also be achievable using az cli cmdlets that I have mentioned above which will help to fix your issue.这也可以使用我上面提到的az cli cmdlet 来实现,这将有助于解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Azure Function App 中删除多个函数 - Remove several functions from Azure Function App 如何使用Azure Function CLI的--usehttps(运行主机选项),但使用Visual Studio Tooling for Azure Functions - How to use Azure Function CLI's --usehttps (run host option) but from Visual Studio Tooling for Azure Functions 部署后,Azure 函数未出现在函数下 - Azure function not appearing under functions after deploying Azure Functions 不会被 VS 发布的新内容覆盖? - Azure Functions not be overwritten by new content published from VS? 更改从Visual Studio发布的Azure for Azure功能的计时器间隔 - Change timer interval in Azure for Azure Function published from Visual Studio Azure 函数已成功发布但在 Azure 门户中丢失 - Azure Function successfully published but missing from Azure Portal 未在Function App中显示Azure Functions - Azure Functions not showing in Function App 可以在本地连接到Salesforce连接的应用程序,但不能在Azure功能中发布时连接 - Can connect to Salesforce connected app locally but not when published in Azure function 使用 http 向现有 Function 应用程序添加/删除 Azure 功能 - Adding/removing Azure functions to/from existing Function App using http Azure函数CLI中的ServiceBusTrigger? - ServiceBusTrigger in Azure functions CLI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM