在Azure App服务中从8172更改WebDeploy端口

时间:2018-11-12 09:28:55

标签: azure azure-web-sites webdeploy

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

是否可以在App Service中更改用于WebDeploy的端口?

3 个答案:

答案 0 :(得分:1)

否,无法更改Web部署端口。这是基础IIS服务的配置,由同一主机上的所有用户共享。

答案 1 :(得分:0)

似乎不可能,所以我换了新的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
}

答案 2 :(得分:0)

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