[英]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"
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.