AWS/Azure/OpenShift

How to deploy a .NET application to AWS Elastic Beanstalk using AWS Tool Kit

image-166

An AWS Elastic Beanstalk helps you to instantly deploy and manage any applications on the AWS platform without learning about the infrastructure that runs the applications. It helps to manage the complexity that comes with application deployment and also gives you complete control of the processes. All that is required by you is just to upload your application and Elastic Beanstalk does other tasks like capacity provisioning, load balancing, scaling, and monitoring of the application health. After you deploy your applications developed in the language supported by Elastic Beanstalk, it will help you build the application and also provide the computing services needed to run the application like Amazon ECE instances. There is a console and AWS CLI that you can use to interact with Elastic Beanstalk. For related guides on AWS Deployments read How to Deploy MVC Application to AWS EC2 Using RDP Connection and Web Deploy, How to Deploy Dynamic Website to AWS EC2, Hosting Static Website and Versioning on AWS S3, How to deploy an Angular App to AWS S3, How to manage cost with AWS Budgets, Creating IAM Users, Adding MFA and Policies on AWS.

Let’s now create our environment

To make the setup faster you can use the Create New Application wizard in the Elastic Beanstalk console to create your environment.
– Choose .NET as the platform

Follow these steps

  • Enter the application name, if you wish you can enter tags. You can leave the default environment information.
image-167
Creating a Web app
  • In the Platform drop-down select the platform and platform branch that matches the language you used to develop your application.
image-168
Selecting your Platform
  • You can Upload your code from your repository. But in this guide we will be using a Sample application for our demonstration. Choose Review and launch it.
image-169
Application code
  • Now review all the options and you can decide to edit or choose the available option you want to use. After this you can then go ahead to Create app.
image-170
Creating your Environment
  • Now let’s go to the environment we just created with the sample .Net code
image-171
Environment Overview
  • If you receive the below Congratulations page it means your environment is set.
image-172
AWS Elastic Beanstalk

It is now time to Publish our local application to Elastic Beanstalk through AWS Toolkit

  • Make sure you install the extension AWS Toolkit from Visual Studio Market place inside your Visual Studio so that you will be able to publish your application to Elastic Beanstalk.
image-173
Managing your Extensions
  • Close Visual Studio and allow the installation to begin…..
image-174
Installing the extension
  • Confirm the Health status is Ok which will confirm that the environment launched successfully.
image-175
Application Running
  • In Visual Studio, open your application. In this guide I will open the sample application TechdirectarchivedotNetSample.sln.
image-176
AWS Toolkit for Visual Studio
  • From the Solution Explorer expand ‘TechdirectarchivedotNetSample.sln’ and build it to confirm there is no bugs.
  • Right-click MVC5App and from the context-menu select Publish to AWS Elastic Beanstalk.

Note before you Publish to AWS Elastic Beanstalk you need to Create Profiles for your AWS Access Credentials for AWS Toolkit in Visual Studio

image-177
Selecting Publish to AWS Elastic Beanstalk
  • On the Publish to AWS Elastic Beanstalk page enter your account profile details. Under the Deployment Target section select Redeploy to an existing environment and choose your application.
image-178
Deploying your application from local system to AWS Elastic Beanstalk

Click Next and when everything goes right you will get the below image

image-179
Deploying your application from local system to AWS Elastic Beanstalk

Now let’s launch the URL

http://techdirectarchive-env.eba-ffcrrdab.us-east-2.elasticbeanstalk.com/

image-180
Successfully deployed the application to AWS Elastic Beanstalk via AWS Tool Kit

I hope you found this blog post on How to deploy a .NET application to AWS Elastic Beanstalk using AWS Tool Kit very interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x