Currently, I am in the process of deploying to an Azure Function App from a container that resides inside Azure Container Registry.
To begin with, I utilized the func init
command (selected the typescript option) and incorporated some code using the service bus topic trigger template. Upon testing with npm start
locally, everything seems to be functioning correctly. There is a "prestart" command specified in the package.json file that builds the TypeScript which appears as follows:
"prestart": "npm run build && func extensions install",
The build operation generates a dist directory whereby when it initializes, it displays the following:
[8/14/19 8:45:43 PM] 1 functions loaded
All seems to be fine at this point. However, issues arise once I proceed to deploy this function to my function app from the Azure Container Registry.
When inspecting the container error logs via Kudu, I encounter the following messages:
2019-08-14T20:51:05.870505061Z The following 1 functions are in error:
2019-08-14T20:51:05.870515162Z ehmTopicTrigger: Invalid script file name configuration. The 'scriptFile' property is set to a file that does not exist.
2019-08-14T20:51:05.870540263Z
If I attempt to run func start
locally without the presence of the dist directory, I encounter the same error. This suggests to me that when the docker container initializes within the Function App environment, it may not be executing npm start
or failing to build and create the dist
directory for some reason.
I do not believe that committing and deploying the dist
directory is the solution, especially considering that the .gitignore included in the template contains /dist.
What could possibly be the flaw in my approach?