I’m programming automation to my CI/CD Gitlab to deploy my Azure Functions projects programmatically.
But I’m having an issue when I publish a new function to a function app created previously using az cli like the example below:
$ func azure functionapp publish $AZURE_APP_NAME ${SLOT_PARAMETER} ${FUNCTION_LANGUAGE} --nozip
$ az webapp config appsettings set -g $AZURE_RG_NAME -n $AZURE_APP_NAME ${SLOT_PARAMETER} --settings "WEBSITE_RUN_FROM_PACKAGE=0"
The command line shows that the new function was built, created and deployed successfully. But when I check if the new function was created in my app using the Azure Console UI nothing was shown.
I even tried deploying the function as a zip package using the default publish
command or like the example above using --nozip
and setting WEBSITE_RUN_FROM_PACKAGE=0
to deploy files.
It’s strange because I could see the deployed function for another app function using the same script. In this way the behavior of the console UI function app seems erratic.
2
Answers
As was mentioned by @pravallika-kothaveerannagari I needed to enable
SCM_DO_BUILD_DURING_DEPLOYMENT=true
during the deployment of my function to build it on the App Service.Besides, I've changed the deployment of the function to
az functionapp deployment source config-zip
, and not using Azure Function core tools anymore.When you are doing continuous deployments for the Azure Function App, you have to enable one of the configuration settings in the Azure Portal Function App > Configuration Menu i.e.,
SCM_DO_BUILD_DURING_DEPLOYMENT=true
.After configuring this setting, then deploy using
az cli
command or function core tools commandfunc azure functionapp publish
, it will show the Functions in the Azure Portal Function App.Refer to this SO Thread regarding the similar issue i.e., No Functions showing after deployment/publishing.