This article is a step by step guide to deploy an ASP.NET MVC application by using Web Deploy on IIS server, running on Amazon EC2 Windows server.
Step 1: Launch Instance
Before Launching Instances, AWS console prompts you to create a key pair file (.pem file). Once you created the .pem file, download the file to your local machine as this file will be used to obtain passwords for Windows Machine.
Once the instance is in running state, click Connect (It takes around 5-10 min to retrieve the password). It prompts you to upload the .pem file that you have created above. Once you have uploaded the file it will decrypt the file and delivers you a random Password which will be used to connect to Instances using RDP (Remote Desktop Client).
Note: Make sure to open Port 3389 for RDP connections in the security group.
Step 2: Connect to Instances using RDP
You can use Remmina RDP in Ubuntu to connect to Windows Instance with Username: Administrator and Password: (that console delivers after decryption process)
Step 3: Install Web Platform on Windows Server Instance
Web Platform Installer is a free tool used to automate the installation of the Microsoft Web Platform (e.g IIS/Visual Studio) and some third party softwares like WordPress/Drupal/Joomla
Once this is installed, Open Web Platform and search web deploy
Step 4: Install web deploy for Hosting Servers
Step 5: Set up IIS Server with .NET FRAMEWORK features
Press Window + Q, Open Server Manager, it will look like this
Click on Add Roles and Enable following features:
Web Server (IIS) + Application Development and all features listed in below figure.
Step 6: Add website to IIS
- ->Create a directory c:\inetpub\wwwroot\deploy
- ->Start IIS and add a website.
Make sure to choose Application pool same as your application .NET version.
Step 7: Publish Website from Visual Studio
On your local machine, open up Visual Studio.
Create a new ASP.NET web application (.NET framework 4.0) with name “deploy”.
Once the application is set up, click on Build on the navigation bar and select Publish deploy.
You will get the following dialogue box.
Add the credentials and hit the Publish button. If everything goes well you will get your application page.