Can you create a web app + database using windows

Derek Ruf 6 Reputation points
2023-01-05T16:19:47.357+00:00

When creating a web app + database, there is no option to select the operating system and it defaults to linux. Is it possible to create a web app + database using windows as the operating system or to modify an existing web app + database to use windows?

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-01-05T21:24:18.56+00:00

    Hi @Derek Ruf ,

    It sounds like you're using the new web app + database blade in the azure portal which is currently in preview. I repo your scenario using that blade and I couldn't change the OS to windows like you described above. I have shared this feedback with the engineering team and will let you know when I received an update from them

    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 --runtime "dotnet|3.1" --os-type Windows  
      
    # 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

    Hope that helps. Please let us know if you have further questions

    Thanks,
    Grace


    --If the reply is helpful, please Upvote and Accept as answer--


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.