Freigeben über


How to run classic ASP on Azure Web Apps

Overview

We mention you can use ASP on Azure Web Apps but documentation is a bit scarce.  This walkthrough will show how to deploy a simple vbscript ASP page to a Azure Web App.

Steps

Create a Classic ASP page

I will use the App Service Editor built into the Azure Portal.  Simply go to your Web App (or create one if you don’t have one yet) and choose the App Service Editor:

snip_20170511085109

Hint:  You can get there quickly if you know your Web App Name by going to https://YOURWEBAPPNAME.scm.azurewebsites.net/dev

In the Editor, hover over the WWWROOT directory, then choose the New File icon and call your page whatever you wish (using  .asp as the extension).  In this case I choose default.asp so it will run as the default page.   Then add your VBScript asp page code (note you need to specify the Language parameter as shown:

 

snip_20170511085403

Sample code:

 <%@ Language="VBScript" %>
 <html>
        <head> </head>
        <body>
            <h1>VBScript Powered ASP page on Azure Web Apps </h1>
    <%  
  Dim dtmHour 

  dtmHour = Hour(Now()) 

  If dtmHour < 12 Then 
    strGreeting = "Good Morning!" 
  Else   
    strGreeting = "Hello!" 
  End If    
%>  

<%= strGreeting %> 
        </body>
</html>

 

Test it

Now simply browse to your site to see the results!

snip_20170511085701

Conclusion

ASP is supported and enabled by default in Azure Web Apps.  You can easily add ASP pages to you Web App and run them!

Comments

  • Anonymous
    June 22, 2017
    What about if your site requires com objects? Our older sites use http://www.aspemail.com/ for sending email, among other COM objects to do needed tasks. Is there a way to get them registered on the server?
    • Anonymous
      August 29, 2017
      No, there is no way to register COM objects in a PaaS environment. You will need to use Azure Cloud Services or stand up your own Azure VM.
  • Anonymous
    June 30, 2017
    How can you DISABLE classic asp on an app service?
    • Anonymous
      July 06, 2017
      Figured it out:Add this to system.webServer/handlers
    • Anonymous
      July 06, 2017
      It removed the XML ... trying again < add name="AspClassic" verb="" path=".asp" type="System.Web.HttpForbiddenHandler" />