This is so weired. And I am unable to find proper answer. now i dont know if i need to deploy my functions to azure functions app or need to add some keys in host.json or local.settings.json to make it run
func start is stuck, neither shows any error nor listen to 7071 port. so weired.I am using nodejs
Can you check your Node.js application code to ensure that the server is being created properly and that it’s listening on the correct port. otherwise function should run on specific port like func start --port 7072 command.
Run this npm install -g azure-functions-core-tools@latest command for latest version of azure function core tools.
Ensure that all dependencies required by your application are installed correctly. Run npm install to install any missing dependencies or update existing ones.
I have created Http trigger function with runtime stack Node.js in visual studio code by using func init and func newcommands.
In some use cases, this might happen if the function app is trying to connect to a storage account but cannot do this.
To solve this, you have 2 options:
Use Azurite to simulate local storage. If you’re using VS Code, the extension works really great!
Connect to an actual storage account that is hosted on Azure. To do that, just set the connection string in the local.settings.json file with the key AzureWebJobsStorage.
2
Answers
Can you check your Node.js application code to ensure that the server is being created properly and that it’s listening on the correct port. otherwise function should run on specific port like
func start --port 7072
command.Run this
npm install -g azure-functions-core-tools@latest
command for latest version of azure function core tools.Ensure that all dependencies required by your application are installed correctly. Run
npm install
to install any missing dependencies or update existing ones.I have created Http trigger function with runtime stack Node.js in visual studio code by using
func init
andfunc new
commands.function code:
host.json:
The function executed successfully. check below:
check below steps to deploy the function into azure portal.
after selecting the folder and subscription plan and function app should clicked on deploy button like below:
The function deployed successfully and visible in portal like below:
Output:
In some use cases, this might happen if the function app is trying to connect to a storage account but cannot do this.
To solve this, you have 2 options:
local.settings.json
file with the keyAzureWebJobsStorage
.