I use the following code inside my application Application_Start
section. This updates the web.config with the latest token and is used in all the tutorials for Azure AD consuming apps.
My app, which has been running happily, has now failed to start with an Access Denied error to the web.config path linked to this code. The code itself hasn't changed so I assume some security update has come in. I can't find any reference to the error or update online. The security settings on the folder look just fine. A redeploy doesn't resolve this.
protected void RefreshValidationSettings()
{
string configPath = AppDomain.CurrentDomain.BaseDirectory + "\\" + "Web.config";
string metadataAddress =
ConfigurationManager.AppSettings["ida:FederationMetadataLocation"];
ValidatingIssuerNameRegistry.WriteToConfig(metadataAddress, configPath);
}
please check this VS2013 RTM, Organizational Accounts and Publishing to Windows Azure Web Sites