【问题标题】:Change the WebDeploy port from 8172 in Azure App service在 Azure 应用服务中将 WebDeploy 端口从 8172 更改
【发布时间】:2018-11-12 09:28:55
【问题描述】:

要使用 Visual Studio 或 Octopus Deploy 部署到在 Azure App Service 中运行的网站,我必须能够在端口 8172 上从我的部署框建立出站连接。但是这被我的防火墙阻止了。

有什么方法可以更改应用服务中用于 WebDeploy 的端口?

【问题讨论】:

  • 您可以配置任何防火墙以允许端口 8172 上的传入连接。请参阅此article
  • 这是一个大型企业防火墙,阻止了该端口上的出站连接,因此如果可能,需要配置 Azure
  • 在 Visual Studio 中,如果您在发布配置文件中选择应用服务作为发布目标,它将使用 https://<your site>.scm.azurewebsites.net/msdeploy.axd 发布您的站点,而不是使用 WebDeploy。它不需要端口 8172,只需要端口 443。
  • 您能解释一下您所说的选择应用服务是什么意思吗?在Vs中使用向导并点击应用服务仍然发送被屏蔽

标签: azure azure-web-app-service webdeploy


【解决方案1】:

不,无法更改网络部署端口。这是底层 IIS 服务的配置,由同一主机上的所有用户共享。

【讨论】:

    【解决方案2】:

    似乎不可能,所以我已换用较新的ZipDeploy 功能和 Powershell 进行部署:

    $zipDestination = "/file.zip"
    $apiUrl = "https://$appServiceName.scm.azurewebsites.net/api/zipdeploy"
    $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $siteCredentials.username, $siteCredentials.password)))
    $userAgent = "powershell/1.0"
    
    Write-Host "POSTing $zipDestination to $apiUrl as user $($siteCredentials.username)"
    
    try {
        Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method POST -InFile $zipDestination -ContentType "multipart/form-data"
        Write-Host "Publish complete"
    } catch {
        Write-Host "Publish failed"
    
        # Note that value__ is not a typo.
        Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__ 
        Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
    
        Throw $_.Exception
    }
    

    【讨论】:

      【解决方案3】:

      我尝试了 WEBSITES_PORT 和 PORT 以及通过 github 操作从存储库中获取的代码和来自 dockerhub 的 docker 映像(“EXPOSE 8000”在本地工作)。 Azure 包装您的应用程序并仅公开端口 80 和 443。 就我而言,我得到了: github 操作 --> 端口 80 和 HTTP docker 镜像 --> 端口 443 和 HTTPS

      【讨论】:

        猜你喜欢
        • 2019-04-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-14
        • 1970-01-01
        • 2017-03-23
        • 2015-06-28
        • 1970-01-01
        相关资源
        最近更新 更多