Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi @Sylva Obah
If you're using a WebJob though, there isn't an entry point required. The web job will run your js as a script file. So, there isn't a need for npm run start in the app service Configuration blade. However, from what you've provided, it appears you're trying to do is an Azure Function which is a different. For that, refer to Node.js developer reference for Azure Functions | Microsoft Learn. If you're using v3 programming model, you should have a functions.json file in the same folder as getChatGPTSuggestion.js that contains the binding you need, for example, httpTrigger. In your js file, you should have an exported module that accepts the arguments for a httpTrigger which would be context and request.
functions.json
{
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"name": "req",
"authLevel": "anonymous",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
}
getChatGPTSuggestion.js
module.exports = async function (context, request) {
context.log('Http function was triggered.');
context.res = { body: 'Hello, world!' };
};