0

I've the following directory structure for an Azure function app:

    .
    |-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:

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. Then I tried to publish the function by cd into test_func and running the 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. 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. What am I doing wrong? How do I push these files to a new function under TriggerTrainingApp?

Judy T Raj
  • 1,755
  • 3
  • 27
  • 41

1 Answers1

0
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.
  • 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. This can also be achievable using az cli cmdlets that I have mentioned above which will help to fix your issue.

Pravallika KV
  • 2,415
  • 2
  • 2
  • 7