Migrate an ASP.NET web app to Azure App Service

Provision Azure SQL Services (Optional)

These are optional steps if you are using the sample project or if you want to connect your web app to a SQL DB. They may not apply if you’re using your own application.

Create a SQL Server instance

To create a database, you also need an Azure SQL Database logical server. A logical server contains a group of databases managed as a group.

Select Explore additional Azure services.

Configure web app name

In the Services tab, click the + icon next to SQL Database.

In the Services tab, click the + icon next to SQL Database.

In the Configure SQL Database dialog, click New next to SQL Server.

A unique server name is generated. This name is used as part of the default URL for your logical server, <server_name>.database.windows.net. It must be unique across all logical server instances in Azure. You can change the server name, but for this tutorial, keep the generated value.

Add an administrator username and password. For password complexity requirements, see Password Policy.

Remember this username and password. You need them to manage the logical server instance later.

Create SQL Server instance

Click OK. Don’t close the Configure SQL Database dialog yet.

Create a SQL Database

In the Configure SQL Database dialog:

  • Keep the default generated Database Name.
  • In Connection String Name, type MyDbConnection. This name must match the connection string that is referenced in Models/MyDatabaseContext.cs.
  • Select OK.

Configure SQL Database

Provision and publish

The Create App Service dialog shows the resources you’ve created. Click Create.

the resources you've created

Once the wizard finishes creating the Azure resources, it publishes your ASP.NET app to Azure. Your default browser is launched with the URL to the deployed app.

Published ASP.NET application in Azure web app

Congratulations! Your data-driven ASP.NET application is running live in Azure App Service.


I ran into an issue I've published my app