I ran into connection refused issue several time when tried to connect but was able to connect after couple of tries. We should look into the issue, you may be able to get repro logs from https://petclinic.azurewebsites.net/
yiliao@yili-ubuntu-03:~$ az webapp ssh -g appsvc_rg_Linux_centralus -n yili-python-up-08
Auto-selecting port: 34229
SSH is available ( username: root, password: Docker! )
_ssh: connect to host localhost port 34229: Connection refused_