Azure SSH到Web应用程序失败:AppServiceTunnel / Tunnel.ashx?GetStatus'状态码为'404'并且原因为'未找到'

时间:2018-11-07 17:58:17

标签: azure azure-web-sites

我需要sshWeb App上的Azure。在instructions之后,我安装了azure cli,登录并调用以打开隧道:

az webapp remote-connection create -g myresourcegroup -n myapp -p 9000

它将生成此错误堆栈:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
  File "/Users/myusername/.azure/cliextensions/webapp/azext_webapp/custom.py", line 235, in _start_tunnel
if not _check_for_ready_tunnel(remote_debugging_enabled, tunnel_server):
  File "/Users/myusername/.azure/cliextensions/webapp/azext_webapp/custom.py", line 200, in _check_for_ready_tunnel
default_port = tunnel_server.is_port_set_to_default()
  File "/Users/myusername/.azure/cliextensions/webapp/azext_webapp/tunnel.py", line 96, in is_port_set_to_default
url, r.status, r.reason))
knack.util.CLIError: Failed to connect to 'https://myapp.scm.azurewebsites.net/AppServiceTunnel/Tunnel.ashx?GetStatus' with status code '404' and reason 'Not Found'

我怎么从这里走?我在MacOs上。

编辑:

错误之前debug跟踪的几行:

msrest.http_logger : <publishData><publishProfile profileName="hxserver1 - Web Deploy" publishMethod="MSDeploy" publishUrl="hxserver1.scm.azurewebsites.net:443" msdeploySite="hxserver1" userName="$hxserver1" userPWD="bRqeRL3xwe1K2Wuqi3MX6oFZMlASg3jSt3bE9lN4YygiNafTvJSrgbTNMLz1" destinationAppUrl="http://hxserver1.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites"><databases /></publishProfile><publishProfile profileName="hxserver1 - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod-blu-083.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="hxserver1\$hxserver1" userPWD="bRqeRL3xwe1K2Wuqi3MX6oFZMlASg3jSt3bE9lN4YygiNafTvJSrgbTNMLz1" destinationAppUrl="http://hxserver1.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites"><databases /></publishProfile></publishData>
urllib3.connectionpool : Starting new HTTPS connection (1): hxserver1.scm.azurewebsites.net
urllib3.connectionpool : https://hxserver1.scm.azurewebsites.net:443 "GET /api/settings HTTP/1.1" 200 574
urllib3.connectionpool : Starting new HTTPS connection (1): hxserver1.scm.azurewebsites.net
urllib3.connectionpool : https://hxserver1.scm.azurewebsites.net:443 "GET /AppServiceTunnel/Tunnel.ashx?GetStatus HTTP/1.1" 404 67

1 个答案:

答案 0 :(得分:0)

  

还有另一种SSH到机器的方法吗?我需要它从我的工作   Mac。

对于您的评论,您真的想知道如何SSH到您的网站,可以在Azure门户的Web应用程序服务页面上单击“ SSH”。

enter image description here

关于您的问题,当您使用az webapp remote-connection创建TCP隧道时,似乎存在一些CLI错误“ CLIError:无法连接到状态代码为404且未找到原因的KUDU站点” ,而不是您身边的实际错误。您还可以在门户网站上使用SSH来访问Web应用程序Linux容器。

在公共预览中,对于给定的应用程序,我们在任何给定时间仅支持单个TCP隧道。我们计划在Public Preview之后的将来版本中删除此限制。请参阅此blog

使用预览版时,可能会有一些不舒服的SSH体验。您可以在github上查看类似的开放方案。