Azure Admin Pages not loadingany resources from MVC

Kentico Dev asked on September 17, 2020 18:01

I have a Kentico 12.0 site hosted on Azure.

When I browser to the Admin -> Pages app and load the "Page" tab of a pagebuilder-enabled page, none of the resources from the MVC site get loaded. I receive an error like this:

Image Text

I have tried the following:

  • Enabled CORS settings on Azure
  • Added builder.UseResourceSharingWithAdministration(); to ApplicationConfig.RegisterFeatures
  • Ensured that the admin domain and presentation domain in the Sites app are set correctly: admin.sitename.com and https://www.sitename.com
  • I ensured that the hash salt string is the same for MVC and Admin and resigned all macros in the System app
  • Cleared cache/memory and restarted app multiple times
  • Made sure this is called in route config: routes.Kentico().MapRoutes();
  • Checked that the resources are actually there. If I remove the GUIDs and just navigate to www.sitename.com/<path-to-resource> it actually works. The whole cmsctx thing is the problem

This used to work fine until a week ago when we moved to Azure, I'm not sure what else I need to change.

The MVC site otherwise works fine when viewing it directly. The Admin site is otherwise fine.

What else can I try?

Correct Answer

Kentico Dev answered on September 17, 2020 23:57

I found the cause, in case anyone else has the same issue. These entries in the web.config were causing issues:

<staticContent>
  <mimeMap fileExtension=".otf" mimeType="font/otf" />
</staticContent>

and

<rewrite>
  <rules>
    <rule name="RewriteASPX">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions>
      <action type="Rewrite" url="{R:1}" />
    </rule>
  </rules>
</rewrite>
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.