Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I manually deploy a .NET MVC app to AWS via Elastic Beanstalk

I'm trying to deploy a simple Hello World ASP.NET MVC 4 app to an free tier EC2 instance using elastic beanstalk. I'm using Visual Web Developer Express (2010) which doesn't support the AWS Toolkit extensions, so how do I deploy the site without the extension?

It seems that with the Elastic Beanstalk web console, you can upload a file as a new applicaiton. But I can't figure out what's supposed to be in the file. Is it a zip containing a published mvc app? I tried that, and when navigating to the instance after it loaded it just displayed the IIS 8 logo. There's a sample zip on a walkthrough page, but it's an old ASP.NET page with 3 xml files in the root. I have no idea what to change in those files for MVC, .NET 4, Server 2012, or IIS 8. I can't find this information anywhere.

I tried creating some EC2 instances manually, remoting in and deploying the site myself. However the free Windows Server 2008 images don't have .NET 4. And the free Windows Server 2012 image doesn't have IIS... I couldn't figure out how to actually deploy my site.

like image 894
Ross Avatar asked Apr 14 '13 04:04

Ross


1 Answers

The command line tool that's called by the AWS Toolkit extension can be used manually. Here is the documentation I found on deploying using this tool.

You have to publish your site as a Web Deploy Package in Visual Studio. Then use the tool located in Windows by default at

C:\Program Files (x86)\AWS Tools\Deployment Tool>awsdeploy.exe

You have to pass it a text file that contains the deployment configuration. There's a template for the file at

C:\Program Files (x86)\AWS Tools\Deployment Tool\Samples\ElasticBeanstalkDeploymentSample.txt

The first time I used the tool, deploying the package archive generated by Visual Studio, I still got the plain IIS 8 landing page. However, when I did an incremental deployment, which is done via an extracted version of the archive being pushed to the server, it worked fine.

like image 189
Ross Avatar answered Oct 12 '22 22:10

Ross