Run ASP.NET Core app on IIS

It is easier to deploy an ASP.NET Core app on Azure Web Service because we don’t need to manage a virtual machine in this case. But some times we need full control on our environment and for that virtual machine on Azure is the option.

Below is the steps to deploy (framework dependent deployment) and run an ASP.NET Core app on an Azure virtual machine.

  1. Create a new ASP.NET Core app with Visual Studio or .NET Core CLI.
  2. Build and run the app from local machine.
  3. Login to Azure portal and create a virtual machine with Windows Server 2019.
  4. Login to the virtual machine with remote desktop connection.
  5. Install IIS from Server Management (add or remove features).
  6. Install ASP.NET Core Hosting Bundle.
  7. Deploy the ASP.NET Core app as framework dependent deployment to a local folder in your machine.
  8. Create a folder in the local drive of the virtual machine.
  9. Copy the deployment output from your local machine to the virtual machine.
  10. Open IIS management studio and create a new app pool with your Windows admin user credentials. The .NET runtime version of the app pool will be ‘no managed code’. The identity of the app pool will be ‘local user’.
  11. Create a new website and use the new app pool. Attach the location where you placed the deployment artifacts.
  12. Browse the newly created website and it should work fine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s