Hi @Premsagar ,
We sincerely apologize for the delay in response and appreciate your patience.
The error message "A function can only be registered during app startup" indicates that the function registration is being attempted after the application has already started executing. To resolve this issue, ensure that your function registration code is executed at the global scope and is included in the entry point of your application (the file specified in the main
field of your package.json
).
- Make sure that you are not trying to register functions after the app has started processing requests. All function registrations should be done before any requests are handled.
- Additionally, verify that your project structure is correct and that the necessary files are in place, including the
host.json
and the function-specific folders with their respectivefunction.json
files.
Also, for your better understanding, please refer to the following documentation:
Azure Functions Node.js developer guide
Troubleshoot Node.js apps in Azure Functions
By following these steps, you should be able to resolve the issue with loading the function. If the problem continues, please provide additional details for further assistance.
If you find the answer helpful, kindly click "Accept Answer" and upvote it. If you have any further questions or concerns, please feel free to reach out to us. We are happy to assist you.