在 Azure 应用服务中将 WebDeploy 端口从 8172 更改为

Change the WebDeploy port from 8172 in Azure App service

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

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

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

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

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