When going through the Web app + database creation in Azure, is sets the OS to Linux by default. How do I set up it up such that the OS is Windows instead?

Genesis Support 301 Reputation points
2025-03-10T17:42:39.2066667+00:00

Hi Guys,

I've chosen the option in App Services to create Web App+Database.

User's image Whilst going through the set up, I set my:

  • Runtime stack to .NET 8(LTS)
  • Engine to SQLAzure (recommended)

Everything else is set to default (see image):

User's image

User's image

When I review the setting it shows that the Operating System is Linux...

How do I go through this same set up (Web app+Database) such that the the Operating System is Windows instead?

Kind regards

GMSS

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,443 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Divyesh Govaerdhanan 2,010 Reputation points
    2025-03-10T23:04:29.2866667+00:00

    Hello,

    Welcome to Microsoft Q&A,

    I see your concern about the OS not being able to be changed to Windows from Linux when using the "Web App + Database" option. As per the answer provided in the below question, this option is still not being implemented. https://learn.microsoft.com/en-us/answers/questions/1153250/can-you-create-a-web-app-database-using-windows

    In the meantime, a workaround is to use CLI to create a web app + SQL database and connect them. You can use the below CLI commands:

    # Create a web app  
    az webapp create --resource-group myResourceGroup --plan myHostingPlan --name myWebApp 
      
    # Create a database  
    az sql db create --resource-group myResourceGroup --server myServer --name myDatabase --service-objective S0  
    

    After creating your web app and database, you can use the az webapp config connection-string set command to set the connection string for your web app. You can use the below CLI commands:

    az webapp config connection-string set --resource-group myResourceGroup --name myWebApp --settings myDatabaseConnectionString="connection string"  
    

    You can also achieve the same results in the portal by following this tutorial: Deploy an ASP.NET Core and Azure SQL Database app to Azure App Service

    Please Upvote and Accept the answer if it helps!!

    0 comments No comments

  2. Genesis Support 301 Reputation points
    2025-03-11T10:35:37.2033333+00:00

    Hi Divyesh,

    Many thanks for your reponse.

    Can I just check as I need .NET8 for my runtime stack. What will the sytax be when creating the web app using the CLI be? Will it be "dotnet|8" --os-type Windows as opposed to what is written below?

    #Create a web app

    az webapp create --resource-group myResourceGroup --plan myHostingPlan --name myWebApp --runtime "dotnet|3.1" --os-type Windows

    Kind Regards

    GMSS


  3. Sampath 925 Reputation points Microsoft External Staff
    2025-03-11T12:39:34.3666667+00:00

    Hello @Genesis Support

    Since the App Service plan already includes the Operating System details , there is no need to use --os-type Windows. Use the following command:

    az webapp create --resource-group sampath_group --plan sampath --name myWebApp223333 --runtime "dotnet|8"
    

    Hope this helps!

    If you found this answer helpful, please click Accept Answer and consider upvoting it /click yes.

    accept

    If you have any further questions, please click Comment.

    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.