2
votes

I'm trying to upload a zip file to KUDU for a development webapp and have the files extracted to the root of wwwroot folder

URL i'm using is https://webappname.scm.azurewebsites.net/api/zip/site/wwwroot

Code to upload to zip is:

     $result = Invoke-RestMethod -Uri $kuduUrl `
                    -Headers @{Authorization=$kuduheader;"If-Match"="*"} `
                    -Method PUT `
                    -InFile $ZipFileLocation `
                    -ContentType "multipart/form-data"

It is uploading the .zip file but rather than extracting the files to the root of the wwwroot folder it is creating a folder in wwwroot called the same name as the .zip file

I'm sure it's someting very simple but i've been looking for a couple of hours without luck!

Thanks in Advance!

1
Did you zip a folder called wwwroot (with its content) or the content? Basically, you might have zipped the wwwroot folder, so when it unzips, it will include the wwwroot folder. If all you want is the content, then go into the wwwroot folder and zip the content only. Take a look at this answer to zip content of folder, without including the folder. You can see they go into the folder then zip the contents: unix.stackexchange.com/a/182036 - Cloud SME
@Stanhope4 did you ever get your question resolved? I have a similar issue here (using the zipdeploy api): stackoverflow.com/questions/57100250/… - apleroy

1 Answers

0
votes

The most likely reason is that your zip file contains a root folder called wwwroot, causing the duplication.

As an aside, the zip controller is not a very good choice for deployment. Please try the new zipdeploy feature instead.