Under Settings > Configuration for an Azure Web App Service, if the .NET Version is changed (followed by "Save") to either .NET 9 (STS), or to .NET 8 (LTS), and then Publish (having referenced the appropriate net9.0 or net8.0 target frameworks in the solution), the App Service fails to start up properly.
The following error page is displayed:
HTTP Error 500.30 - ASP.NET Core app failed to start
Meanwhile, Azure reverts the configuration for the App Service back to .NET 6 (LTS) (deprecated).
Under Settings > Configuration for an Azure Web App Service, if the .NET Version is changed (followed by "Save") to either .NET 9 (STS), or to .NET 8 (LTS), and then Publish (having referenced the appropriate net9.0 or net8.0 target frameworks in the solution), the App Service fails to start up properly.
The following error page is displayed:
HTTP Error 500.30 - ASP.NET Core app failed to start
Meanwhile, Azure reverts the configuration for the App Service back to .NET 6 (LTS) (deprecated).
HTTP Error 500.30 - ASP. NET Core app failed to start
The above error usually occurs due to issues with application code or dependencies, missing .NET Runtime version.
For you It may be due to dependencies because you're changing core versions from core 6 to core 8 to core9.
When a configured runtime fails to start, it tries to revert to .NET 6 (LTS, deprecated) rather than .NET 8, which could be due to cached settings or older infrastructure.
When you upgrade app to higher versions make sure to delete obj
and bin
folders and update the NuGet Packages
.
Example .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
</ItemGroup>
</Project>
Clear the NuGet Storage by selecting Tools -> NuGet Package Manager -> Package Manager Settings -> NuGet Package Manager -> General -> Clear All NuGet Storage -> OK.
Before deploying your app to Azure, delete the wwwroot
folder using the Kudu Console. This may help clear the previous deployment.
If still facing the issue check Azure logs for detailed errors using below command Or Create new Azure Web app.
az webapp log tail --name <AppServiceName> --resource-group <ResourceGroupName>
Azure Output: