question

AndrewHB-6266 avatar image
0 Votes"
AndrewHB-6266 asked AndrewHB-6266 commented

What's behind an App Service (Web App)

Just looking to migrate a legacy ASP.NET 4.5.2 application to Web App's and it doesn't seem to be honouring the web.config file setup for things such as default document etc. we also have lots of inline HTTP modules etc.

Are web apps just completely different to hosting in IIS?

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

An App Service is literally just a VM running IIS. Everything is the same provided you configured the app service to actually run .NET which is an option when you set up the service. IIS is running in the background, your site is deployed to a specific folder and IIS is adjusted to host it just like on a normal IIS instance.

My gut instinct is that your configuration isn't correct. However I should also point out that app services are configurable via the slot settings that your site is hosted under so it is also possible that you have overridden the configuration settings. Go to the Azure portal and then to your app service. Under Settings\Configuration go to the Default Documents tab. This is going to override your config settings I believe but it is possible it might pull from your config to get the list. I've never bothered to look.

Use Kudu to view your site's file system and ensure the web.config is properly deployed. Under the app service in the portal go to Development Tools\Advanced Tools. Click Go to bring up Kudu. Personally I then use the nav at the top to go to Debug console\Powershell. You can see the file system and make changes if needed.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

learn2skills avatar image
0 Votes"
learn2skills answered

Hi @AndrewHB-6266

Azure App Service is an HTTP-based service for hosting web applications, REST APIs, and mobile back ends. You can develop in your favorite language, be it .NET, .NET Core, Java, Ruby, Node.js, PHP, or Python. Applications run and scale with ease on both Windows and Linux-based environments.

Migrate .NET web apps with ease
Bring your web apps to the cloud with minimal or no code changes using the Azure App Service Migration Assistant - a free and simple tool to automatically migrate .NET web applications from on-premises to the cloud.

Migrate in three easy steps
Quickly assess your website for migration by running a scan of its public URL.
Download the Migration Assistant to run readiness checks.
Migrate your web app.
Azure App Service migration assistant

Configure an ASP.NET app for Azure App Service


If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewHB-6266 avatar image
0 Votes"
AndrewHB-6266 answered

Thank you for your response, our apps don't migrate automatically, not that I ever thought they would LOL!

I have deployed simple ASP.NET .NET Framework application to a Web App and although it displays things like the default document aren't working. I assume this is because the App Service is not using the web.config in the same way that a Cloud Service (Extended Support) service does as that just has a VM with IIS installed upon it.

I was just checking to see if there was some magic switch that I had missed where I can tell the app service to behave in the same manner as my Cloud Service i.e. use the web.config

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewHB-6266 avatar image
0 Votes"
AndrewHB-6266 answered AndrewHB-6266 commented

Haha! Thank you @cooldadtx

I chose ASP.NET 4.8 when I deployed, should I have chosen .NET I seem to remember that being a separate option in the dropdown?

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If you have an ASP.NET 4.5.2 app then you really need to update it to .NET 4.7.2 or higher first but it likely isn't impacting your site behavior. Just a precaution.

In Azure you'll choose the .NET stack and then the version will be ASP.NET 4.8 which uses the CLR 4.x runtime that you're using locally. If you update to .NET 5 or switch to Core then you'll change the version at that point from here as well.

0 Votes 0 ·

Ah OK I think I did select it right then the choices are: -

  1. .NET 5

  2. .NET Core 3.1 (LTS)

  3. .NET Core 2.1 (LTS)

  4. ASP.NET V4.8

  5. ASP.NET v3.5

And I chose option 4 and this doesn't seem to considering the options set in the web.config the documents I understand if you say the configuration overrides it but we have modules configured like this: -

         <modules>
             <add name="AuthenticationModule" type="Caboodal.Manatee.Web.Authentication2.AuthenticationModule, Caboodal.Manatee.Web" preCondition="managedHandler" />
         </modules>

and these weren't running either, the site did run up and display the page and its controls etc.



0 Votes 0 ·

HTTP modules will definitely load as this is how most apps work. I recommend that you use Kudu to ensure the files are correct on the app service. But to clarify your modules should be listed under system.webServer as this is what IIS reads from. Historically there was another place you could put them that was specific to ASP.NET but that was deprecated years ago IIRC.

Here's a blog article from MS about using HTTP modules and handlers in Azure. As you can see they just work because the app service is just running IIS.

It might be time to turn on diagnostic logging in your app so you can see the modules loading. This is the same thing you'd do with an on-premise server. Alternatively turn on remote debugging and debug from VS.

0 Votes 0 ·
Show more comments