This is for the Exercise - Create a function locally by using the Core Tools.
These are the command lines (one at a time) I used to get it to work (I am using bash).
You cannot make any root-level changes because you are not really using your computer.
- Create a directory for global npm packages:
mkdir "${HOME}/.npm-global"
- Configure npm to use the new directory:
npm config set prefix "${HOME}/.npm-global"
- Add the new directory to your PATH:
export PATH="${HOME}/.npm-global/bin:$PATH"
- Reload your shell configuration:
source ~/.bashrc
- Now you can install the azure functions core tools globally:
npm install -g azure-functions-core-tools@4 --unsafe-perm true
Also be careful when you select the trigger for the function, the exercise says 7 for HTTP trigger but check the Cloud Shell list. For me it was 8, not 7.
You have to repeat steps 2 to 4 if you get kicked out because of inactivity.
Hope this helped.