Thursday, June 3, 2010

FilteredView and ASP.NET Impersonation

A few days ago, we re-deployed a CRM project in staging server for maintenance purpose. We did normal re-deployment processes such as backup live database, imported it into staging server, run deployment manger to re-configure the settings, re-deployed extension pages, etc.

We tested CRM application and it was working fine. Yesterday, we noticed all extension pages (aspx) using  "Filtered Views" to retrieve data from SQL Server were not working properly. We are using "Filtered Views" in stored procedures to retrieve data from SQL Server. 

Below is the list of steps I did for troubleshooting:
  1. The login user was a member of System Administrator Role. So, it could not be an Access Rights issue.
  2. I run one stored procedure under login user's credential (using EXECUTE AS command) and it was working properly. I can retrieve the data. So, impersonation process was working fine and it can be either configuration error or impersonation cannot go through from website to SQL Server.
  3. I checked all registry values, application settings, IIS configurations, IE settings and system configuration data in MSCRM_CONFIG and CRM database respectively. All settings were correct.
  4. Finally, I added <identity impersonate="true" /> in web.config file of our extension project. Then, system prompted there was another impersonation setting already configured in that file. I searched the value and found that impersonation was set to false.
This happened because one of my colleagues accidentally configured impersonation setting through IIS's website properties. This is not a big issue, but it took me about one hour to resolve this. So, I blog this post to save your time and save my time in future if I forgot it. :-)


1 comment:

Anonymous said...

I am having the same issue. Please provide a solution if you managed to fix this.

Post a Comment