Deploy Static Content In An App That Uses Platform Services

Follow

In certain cases, you may deploy web apps that contain nothing but static content such as .html, .htm, .js, .css, etc.

When you deploy an application that has only static content, requests to that application will not invoke the ASP.NET pipeline.  IIS is configured, by default, to simply serve up static content without running any processing on the files.  Because the ASP.NET pipeline is not invoked, Apprenda's hook points for introducing platform services like authentication or authorization are not fired. The result, for example, is that an application that is deployed with the 'Authentication' platform service will not require authentication - the content of the app will be publicly accessible.

As an app developer, though, you have control over the app's behavior via the web.config.  If you run into this issue, you can add Script Mappings in your web.config that will invoke the ASP.NET pipeline for certain static content, thus invoking Apprenda's platform services.

Here's an example of how to invoke ASP.NET for .htm and .html files:

    <system.webServer>
        <handlers>
            <add name="HTMLtoASP_32" path="*.html, *.htm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
            <add name="HTMLtoASP_64" path="*.html, *.htm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        </handlers> 
    </system.webServer>

Ensure that this section is included in your app's web.config file.

Have more questions? Submit a request

Comments