Consider this scenario: You create a new web and add several apps. Next, you make some master page modifications and choose the “Reset All Subsites” option when applying the master page. This prompts SharePoint to reset all MasterUrl and CustomMasterUrl properties to point to the root web. Because all of our apps are running in their own App-Web (Aka sub-site) these sites are reset too. So now when are apps are rendered the master page it calling to the root web for its masterpage. This results in error because the app is not allowed to call outside of its own web. (Some scenarios allow cross-site calls).
To fix this we need to rewrite the app master page URL. We can do this for all apps using PowerShell.
$appWebs = (Get-SPSite -Identity <YourSiteCollectionURL> -Limit All).AllWebs | ?{$_.Url -match "<YourAppURL>"} #Your app URL should be company-app.com, etc
foreach ($app in $appWebs) {
$masterUrl = $app.ServerRelativeUrl + "/_catalogs/masterpage/Seattle.master"
$app.MasterUrl = $masterUrl
$app.Update()
}
We can now access the configuration pages within our apps.
{Kam}