Кажется, это невозможно, поэтому я поменялся местами, чтобы выполнить развертывание с более новой функцией 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
}