Is Using web.config File Standard for ASP.NET Core 8 Hosting on Azure App Service?

Kirankumar Bharsadiya 40 Reputation points
2024-09-10T09:12:39.8566667+00:00

Hello Azure Community,

I’m currently working with an ASP.NET Core 8 application hosted on Azure App Service. In previous versions, especially with .NET Framework applications, the web.config file was commonly used for IIS-specific configurations.

I’ve noticed that when deploying my ASP.NET Core 8 application, a web.config file is automatically generated. However, I am wondering whether using the web.config file for configuration is still the standard and recommended approach for ASP.NET Core 8 applications on Azure App Service, or if there are better or more current methods for managing configurations in this environment.

Specifically, I am interested in understanding:

  1. Is the web.config file still a standard practice for configuring ASP.NET Core 8 applications in Azure App Service, or should other approaches be considered?
  2. Are there any particular best practices or considerations for using web.config in the context of Azure App Service?
  3. What are the potential advantages or disadvantages of relying on web.config for configuration in ASP.NET Core 8?

Thank you for your insights and guidance!

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,917 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,609 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,902 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 66,621 Reputation points
    2024-09-10T20:04:49.6266667+00:00

    if you pick windows hosting in azure, then web.config is used to configure the iis hosting module. If you pick Linux, or docker containers then it’s not used.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. AgaveJoe 28,536 Reputation points
    2024-09-10T10:18:21.8933333+00:00

    Is the web.config file still a standard practice for configuring ASP.NET Core 8 applications in Azure App Service, or should other approaches be considered?

    Core uses the appsettings.json file for application configuration as covered in the official documentation.

    https://video2.skills-academy.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0

    The web.config is used bootstrap the asp core module.

    https://video2.skills-academy.com/en-us/aspnet/core/host-and-deploy/iis/web-config?view=aspnetcore-8.0

    1 person found this answer helpful.

  2. rose 0 Reputation points
    2024-09-10T20:05:17.0966667+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.