Are you tearing your hair out trying to manually deploy to your Azure web app, with 'remove additional files at destination' in order to clear it out, but find that publishing fails with the above error?

I had this problem when I needed to nuke some old DLLs (some Glimpse EF dll not in use anymore that StackExchange's MiniProfiler EF was making a song and dance about), but also had an old NewRelic directory hanging around that refused to let itself be deleted by the publish process. Result: failure.

It seemed that the NewRelic stuff was either 'in use' by IIS (though I'd stopped all web apps) or else I didn't have enough admin rights in Azure, either via Kudu's console or FTP to edit/delete files.

So I just needed a way to nuke the site before publishing again, but this was hamstringing me.

Solution: after a lot of googling, I found that this works: create a new deployment slot on your web app, not copying any existing configuration. This creates a vanilla slot.

Next, swap this slot into the main (top, production) 'slot' using the 'Swap' button on the main site. Result: nuked directories!

Now, you are free to publish your site up again.