blog.scoreman.net

Preserving ClientId and ClientSecret in Windows Azure

Here is a quick tips if you are building SharePoint Provider Hosted Apps in Windows Azure. If there are several developers publishing an app (or if you are using publishing in Visual Studio Online) to Windows Azure chances are that ClientId and ClientSecret will be changed in the web.config file. When ClientId and ClientSecret are changed the app will no longer be able to communicate with SharePoint unless you register the app again with the new ClientId and ClientSecret.

Another way to solve this would be to prevent the ClientId and ClientSecret to change. This can be done by overriding what is in the web.config file using built in functionality in Azure. If you set appsettings in the Azure Portal or using solution explorer in Visual Studio these settings will override what is in the web.config file. This way your ClientId and ClientSecret will match what was in the app manifest when the app was registered in SharePoint.

Setting appSettings through the Windows Azure Portal

Setting appSettings through the Windows Azure Portal

Setting appSettings through solution explorer in Visual Studio

Setting appSettings through solution explorer in Visual Studio

Leave a Reply