I'm trying to upload some files to my webapp using Kudu to the below url: https://($websitename.scm.azurewebsites.net/api/vfs/site/wwwroot/ using powershell
I have obtained the publishing username and password and can authenticate fine
However when i try to upload the files i'm getting the below error using the below code:
function Upload-FileToWebApp($kuduHeader,$KuduURL,$files)
{
$kuduURL = https://$websitename.scm.azurewebsites.net/api/vfs/site/wwwroot/
$result = Invoke-RestMethod -Uri $kuduUrl `
-Headers @{Authorization=$kuduheader;"If-Match"="*"} `
-Method PUT `
-InFile $files `
-ContentType "multipart/form-data"
Invoke-RestMethod : {"Message":"The resource represents a directory which can not be updated."}
I have tried to access this URL using the ARC chrome addin and this brings back the same error '409 conflict Message": "The resource represents a directory which can not be updated."
Get seems to work fine
Thanks in Advance!