I deploy MVC 5 application to IIS running on Windows 2012 R2 with WebDeploy 3. Everything is fine except sometimes after successful deployment I get 403 - Forbidden: Access is denied error when accessing the site from a browser. Recycling the pool fixes the issue but it's not suitable option. I expect IIS to automatically recycle the pool once WebDeploy finishes updating the files
..........
Info: Updating file (blabla\Web.config).
Info: Adding ACL's for path (blabla.com)
Info: Adding ACL's for path (blabla.com)
Total changes: 22 (0 added, 0 deleted, 22 updated, 0 parameters changed, 1314018 bytes copied)
Why? How do I troubleshoot the issue?
There are no warnings or errors in Windows Event log (Application, Security, WebDeploy or IIS). The site uses InProc session, targets .NET 4.5, the app pool has default settings (runs under ApplicationPoolIdentity). IIS authentication enables anonymous and forms modules only.