I am using the Kudu Azure Zip Deploy API from powershell.
How can I ensure that the contents of the deployed zip folder are extracted within wwwroot with wwwroot being the containing folder?
Current:
(here my zip folder is the container within wwwroot)
/site/wwwroot/MYZIPFOLDERNAME/CONTENTS
Expected:
(I want the contents of the zip folder to be added directly to wwwroot and outside of the zip folder name)
/site/wwwroot/CONTENTS
I have followed the documentation like below and have a powershell script like below:
https://docs.microsoft.com/en-us/azure/app-service/deploy-zip
#PowerShell
$username = "<deployment_user>"
$password = "<deployment_password>"
$filePath = "<zip_file_path>"
$apiUrl = "https://<app_name>.scm.azurewebsites.net/api/zipdeploy"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username, $password)))
$userAgent = "powershell/1.0"
Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method POST -InFile $filePath -ContentType "multipart/form-data"
When the script is finished, the zipped file is uploaded to my site, however the content is packaged within the folder and nested under the wwwroot directory.
If I use the ZipDeployUI and drag the folder, it unzips into the wwwroot/ directory without the folder name as expected.