I thought I’d do a write up on this one as its something that always catches me out every time I’m configuring a SharePoint farm.
If you are setting up services e.g. Excel Services or Office Web Apps then it’s likely you will need to grant the service account running the service application permissions on your Content DBs.
Unfortunately it seems that SharePoint doesn’t do this for you when provisioning the Service App and you end up getting an error in the event logs when you try and use the service. The error is as follows -
<samp>Source: Microsoft-SharePoint Products-SharePoint Foundation Event ID: 3760 Task Category: Database Level: Critical User: TECHTOOLBOX\svc-spserviceapp-tst Computer: cyclops-test.corp.technologytoolbox.com Description: SQL Database 'WSS_Content' on SQL Server instance 'beast-test' not found. Additional error information from SQL Server is included below. Cannot open database "WSS_Content" requested by the login. The login failed. Login failed for user 'TECHTOOLBOX\svc-spserviceapp-tst'.</samp>
In order to fix this you need to run the GrantAccessToProcessIdentity command for the web application in question. To do this use the PowerShell below -
[code lang="powershell"] $webApp = Get-SPWebApplication http://cyclops
The access should now be granted and you should be able to use the service application.
Hope this helps!