In case, if neither of the above answers work, try the one below, which helped me.
https://medium.com/@elnably/using-azure-functions-core-tools-in-azure-cloud-shell-f417590b2c43