The pain that is WebDeploy and error 401 when publishing
I don't have the time to write down all the things that have done my head in when trying to set up web deploy for the first time. Traditionally I have been using source control to publish sites but on this test one, I thought web deploy would be quick and easy but it has taken me two days to make it work.
The problem was actually the fact that my password wasn't copying correctly from KeePass but of course, because you can't see what is pasted into the box, it looks correct but doesn't work.
The reason this is not great is because, as with many pieces of software, the architecture is not easy to understand and the error messages not descriptive enough to work out what is actually happening. WebDeploy, for instance, consists of two Windows services (although maybe only one?), running that as a user that has permissions to access the web folder and then setting up IIS Manager Permissions and Permissions Delegation in IIS - you can use Windows credentials or theoretically, you can use IIS user permissions, but that only seemed to work when I gave all users full control to access the web directory!
Fortunately, I did (eventually) find a half-decent guide from Microsoft: http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
And this is what finally pointed me to the fact that the password pasted from KeePass wasn't working.
One of the things that annoys me is that I have probably made a load of changes I didn't need while making this work and there's no way I can remember everything I did to revert these things.
The problem was actually the fact that my password wasn't copying correctly from KeePass but of course, because you can't see what is pasted into the box, it looks correct but doesn't work.
The reason this is not great is because, as with many pieces of software, the architecture is not easy to understand and the error messages not descriptive enough to work out what is actually happening. WebDeploy, for instance, consists of two Windows services (although maybe only one?), running that as a user that has permissions to access the web folder and then setting up IIS Manager Permissions and Permissions Delegation in IIS - you can use Windows credentials or theoretically, you can use IIS user permissions, but that only seemed to work when I gave all users full control to access the web directory!
Fortunately, I did (eventually) find a half-decent guide from Microsoft: http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
And this is what finally pointed me to the fact that the password pasted from KeePass wasn't working.
One of the things that annoys me is that I have probably made a load of changes I didn't need while making this work and there's no way I can remember everything I did to revert these things.