Search code examples
reporting-servicesreporting-services-2016

SSRS 2017 Web.config permissions


I have run into an issue with my SSRS 2017 report manager. I have implemented the sample found here and it all seems to work except from the web portal (the server is fine). I have found the solution is that the service user needs to have write permissions to the web.config to copy the machinekey from RSReportingServices.config.

How can I circumvent this? I have tried manually writing to the web.config but the rshostingservice still tries to sync the keys and fails.


Solution

  • I want able to circumvent the need of write permissions. I solved my issue by granting write permission to the service that runs ssrs. i used the below code to bestow the required permissions

            try
            {
                var fileSecurity = File.GetAccessControl(Path);
                var user = ServiceUserDetails();
                fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.Write,
                    AccessControlType.Allow));
                fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.Read,
                    AccessControlType.Allow));
                fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.ReadAndExecute,
                    AccessControlType.Allow));
                File.SetAccessControl(Path, fileSecurity);
            }
            catch
            {
                MessageBox.Show(@"Error",
                    $@"Unable to set permissions for {Path}. Please ensure service has write permission");
            }