We are trying to deploy web app using POWER SHELL with KUDU ZIPDEPLOY, and it's failing with (500) Internal Server Error.
Interestingly it is working fine with CURL command.
The main difference is, in CURL I don't have use PROXY, but POWER SHELL it is asking for PROXY details. I guess this might be I am deploying from organization network.
$username = "`*********"
$password = "********"
$pair = "$($username):$($password)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
$deployUri = "https://testexploreazurewebsites.scm.azurewebsites.net/api/zipdeploy?isAsync=true"
$proxyUri = [Uri]$null
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
if ($proxy)
{
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$proxyUri = $proxy.GetProxy($deployUri)
}
$sourceFilePath = "FilePath.zip"
$responseHeaders = Invoke-WebRequest -Uri $deployUri -ContentType "multipart/form-data" -Method Post -Proxy $proxyUri -ProxyUseDefaultCredentials -Headers $Headers `
-InFile $sourceFilePath `
-TimeoutSec 600000
It was working good till few days back, suddenly stopped working.
Any help please?
Updates and answer
From Kudu log files, the error description is : Missing content-type boundary.
Followed SF post powershell invoke-restmethod multipart/form-data to solve it.