In my case I had added a variable to my local.settings.json of the wrong type.
fixed it by changing this
"FtpPort": "21",
to this
"FtpPort": 21,