Closed nikolaia closed 4 months ago
I wonder if this is the same root cause as #2272, which relates to error propagation in PowerShell scripts. You can try the workaround given by the users there to see if that works here.
I will test more thoroughly when I get the chance. Earlier I was messing up the access token, and 4xx codes made the script, and as a result the deploy in VSTS, fail. I guess that is why I assumed that the zipdeploy endpoint would fail my script when the deploy fails and throws during the Running deployment command...
-step in Kudu. I tried reading the sourcecode, and got the impression that the zipdeploy endpoint returns 200 OK with no body even if the deployment fails, and was wondering if that was by design or should be improved?
@nikolaia I would not expect a 200 if there is a server side failure. Should be a 500 resulting from an Exception being thrown.
I made a pull request with some changes that shows what I think is a logical way for the API to respond to synchronous zipdeploys. Then I can fail easily in my VSTS script:
$response = Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=$bearerToken} -Method POST -InFile $zipPath -ContentType "multipart/form-data"
If ($response -eq "Succeeded") {
Write-Host "Kudu responded 200 OK with body $response"
} else {
Write-Error "Kudu responded 200 OK with body $response"
}
/cc @nickwalkmsft
We are seeing this issue. We get a 200 response back with no body when the deployment has actually failed.
This should be documented if not fixed, as the sync API is unusable in this state.
Hi
If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano Azure App Service
In regards to #2562 and https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file
Loving the Zipdeploy feature as I can write my deployment scripts using FAKE (
.deployment -> deploy.cmd -> deploy.fsx
- all present in the .zip artifact) and can write a smart pipeline for what needs to be done for my WebApps in the same DSL as my buildscript for creating the artifact (since kudusync works offline I can test the scripts 100% on my own machine, so awesome!):However I'm having some trouble getting VSTS to fail when the deployment fails in Kudu (I'm running the call synchronous from an Azure CLI step in VSTS).
This script can be run from my own machine, and is in source control with the build and deployment scripts (again: Awesome!). It is the script called by VSTS:
Seems like I'm just getting 200 OK back from the zipdeploy endpoint, even if the deployment script failed and the deployment is not active. Do I need to poll to check the status of my deployment? Would be nice to get information in the response body about the deployments status after having called the endpoint synchronous.
P.S. Keep up the good work, this feature/endpoint is awesome 💪