0
  1. I want to create WebApp with .NET 6 Runtime Stack, OS as Windows. But not able to find .NET 6 Version while creating web app.

enter image description here

  1. I tried to fetch Web App Stacks via API.
GET https://management.azure.com/providers/Microsoft.Web/webAppStacks?stackOsType=Windows&api-version=2024-04-01

Response From that API:

displayText  value       minorVersions                                         
-----------  -----       -------------                                         
.NET 9 (STS) dotnet9     {@{displayText=.NET 9 (STS); value=9; stackSettings=}}
.NET 8 (LTS) dotnet8     {@{displayText=.NET 8 (LTS); value=8; stackSettings=}}
.NET 7 (STS) dotnet7     {@{displayText=.NET 7 (STS); value=7; stackSettings=}}
.NET 6       dotnet6     {@{displayText=.NET 6 (LTS); value=6; stackSettings=}}
.NET 5       dotnet5     {@{displayText=.NET 5; value=5; stackSettings=}}      
.NET Core 3  dotnetcore3 {@{displayText=.NET Core 3.1 (LTS); value=3.1; stac...
.NET Core 2  dotnetcore2 {@{displayText=.NET Core 2.2; value=2.2; stackSetti...
.NET Core 1  dotnetcore1 {@{displayText=.NET Core 1.1; value=1.1; stackSetti...
ASP.NET V4   aspdotnetv4 {@{displayText=ASP.NET V4.8; value=v4.8; stackSetti...
ASP.NET V3   aspdotnetv3 {@{displayText=ASP.NET V3.5; value=v3.5; stackSetti...

From API Response I am able to see .NET 6 Version and older versions also.

Please I need help to understand this differences

What is the approach to create WebApp with Runtime Stack .NET 6.

is it good to stay with .NET 6 Instead of latest LTS .NET 8 ?

2
  • How you are deploying your app ? Commented May 14 at 9:55
  • 1
    Hi @Harshitha, I am not using, any IAC tools and currently using Azure Portal (UI) to create app services. Commented May 14 at 11:54

4 Answers 4

1

First of all I would recommend to always go to the latest LTS version which would mean .NET 8 in your case. With the latest LTS you can be sure to have the latest stable features and security.

But if you want to stick with an older version and want to create a new webapp you have to use the Azure CLI or the Azure PowerShell which is described here.

The official docs to create a web app can be found here:

But unfortunately is .NET 6 no longer supported which can be seen when you execute the following Azure CLI command

az webapp list-runtimes

If you try to use an unsupported version you get an error that your runtime is not supported. dotnet6 not allowed

Update

The only way to run .NET 6 on a web app is to host containers on your web app. But I would not recommend to use that way because .NET 6 is no longer supported by Microsoft and you don't want to use unsupported versions which are also open to the internet --> Can be a security risk.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @AW94, Thank you for explanation. If I go with Graph API also will get same error?
Hi @AbdulKhadar sorry for my misleading information regarding the Graph API. After another research I found out that my supposed Graph API endpoint was for managing mobile apps in Intune. There is no possibility to create Azure Resource Manager (ARM) Resources like web apps with the Graph API. If you use the Azure PowerShell you'll get the same error as .NET 6 is no longer supported in this way. What you could do is to run a docker container in your web app. But I would not recommend that cause of an unsupported .NET version which is open to the internet.
0

I also check and couldn't find .NET 6...seems it’s not supported and that why its not listed in Azure...however you can try Creating a containerized .NET 6 app Using Azure Container Instances or Azure Kubernetes Service to deploy a containerized .NET 6 application.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

Try this

az webapp create --resource-group MyResourceGroup --plan MyAppServicePlan --name MyAppName --runtime NODE:16-lts

1 Comment

I want to create .NET 6 not --runtime NODE:16-lts
-1

Workaround to create a .NET 6 Web App in Azure

Short version: create a .NET 8 App Service, restore a deleted .NET 6 app into it, then redeploy your .NET 6 content. This effectively converts the new .NET 8 resource into a .NET 6 Web App.

Steps

  1. Prepare Ensure you already have an existing .NET 6 Web App that you can delete.

  2. Delete the existing .NET 6 app Delete the .NET 6 Web App you want to use as template.

  3. Create a new .NET 8 Web App In the Azure portal create a new App Service and choose the .NET 8 runtime stack.

  4. Restore the deleted .NET 6 app onto the .NET 8 app

    • Go to App Services > Manage Deleted Apps.

    • Select the deleted .NET 6 app and restore it, choosing the newly created .NET 8 App Service as the target.

    • After the restore operation the target App Service will become a .NET 6 Web App.

  5. Deploy your application Deploy your .NET 6 code to the restored App Service as usual.

  6. Repeat as needed Repeat steps 3–5 for each new .NET 6 Web App you need.

Why this works

Restoring a deleted app onto an existing App Service applies the restored app’s runtime and configuration to the target, which converts the new App Service to the restored app’s runtime (in this case, .NET 6).

Using at your risk

This is a manual workaround that manipulates deleted-app restore behavior and target App Service configuration. Use it at your own risk. Verify results thoroughly after each restore and deployment before using in production.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.