Nov 19, 2011

Issue with Azure SDK on a SharePoint Server

Few weeks ago I and Hilton Giesenow prepared togheter a SharePoint & Azure session for the TechEd Africa and the European SharePoint conference. During the preparation we discovered an issue running the Azure Compute Emulator on a SharePoint box (Azure SDK 1.5 and 1.6). First it seemed that the user profile service screwed up after you had started the emulator for the first time, but further investigations had shown that many service applications didn’t work properly anymore. The problem was, that the emulator sets the IIS anonymous user account to the application pool’s identity. Many thanks to Wictor Wilen for telling us which IIS setting has been affected ( we owe you a pint=>summit 2011 :)

The Error

The SharePoint error after you have started the Azure Compute Emulator for the first time:  “Object reference not set to an instance of an object”
image
SharePoint trace:
Unexpected System.NullReferenceException: Object reference not set to an instance of an object.    
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()     
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs()     
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext)     
at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable()     at Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls()     
at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable()  

Fix it

To fix this you have just to set the IIS anonymous user back to IUSR. But unfortunately you have to do this every time after you have run the emulator. 

Open IIS Manager (inetmgr) and do the following steps.

 image
image

image
Done.

Fix it with PowerShell

If you don’t like clicking like a monkey, you can fix it with PowerShell Smile
PS> import-module webadministration

PS> set-webconfigurationproperty /system.webServer/security/authentication/anonymousAuthentication -name userName -value "IUSR"


Hope this will save you time.

0 comments: