Deploying Azure function using KUDU api
This is my url:
$apiUrl = 'https://myapp.scm.azurewebsites.net/api/zipdeploy?isAsync=true'
Invoke rest method script :
Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method POST -InFile $zipFile -ContentType "multipart/form-data" -OutFile sample.txt -Verbose
Output I am getting:
VERBOSE: POST https:// myapp.scm.azurewebsites.net /api/zipdeploy?isAsync=true with -1-byte payload
VERBOSE: received 0-byte response of content type
Here my issue is I am not getting any response back and the sample.txt is an empty file. While using the url without isAsync I am getting a time out exception in teamcity that’s why I went for Async deployment
I can verify the portal to see that the deployment is success but how is it possible through the powershell script to verify the deployment status.
In the following site it is mentioned like this :
Async support: By adding
?isAsync=true
to the URL, the deployment will run asynchronously. The Location header of the response will contain the deployment URL that can be polled for deployment status. Webhooks can be used for fully asynchronous notification of completion.
https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file
In this document it is mentioned like this -
The Location header of the response will contain a link to a pollable deployment status.
But I don't know how to get the location header. Please help.