Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk

In this post, we will see how to deploy a Blazor application on Amazon Web Server (AWS Cloud) using Elastic Beanstalk. AWS Elastic Beanstalk is an orchestration service offered from Amazon Web Services for deploying web applications (infrastructure) which orchestrates various AWS services. With Elastic Beanstalk, we can easily deploy and manage web applications in the AWS Cloud without worrying about the infrastructure that runs those applications.

Introduction

In this post, we will see how to deploy a Blazor application on Amazon Web Server (AWS Cloud) using Elastic Beanstalk.

AWS Elastic Beanstalk is an orchestration service offered from Amazon Web Services for deploying web applications (infrastructure) which orchestrates various AWS services.
 
With Elastic Beanstalk, we can easily deploy and manage web applications in the AWS Cloud without worrying about the infrastructure that runs those applications. Elastic Beanstalk reduces management complexity without restricting choice or control. We can simply upload our application, and Elastic Beanstalk automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring. Elastic Beanstalk uses highly reliable and scalable services. You can refer to this URL to get more details on Elastic Beanstalk.
 
I have already discussed the Blazor Framework in my previous articles on C# Corner. If you are new to Blazor, please refer to the below articles to get started with Blazor.

You can refer to the below article to get started with AWS free tier.

Install AWS Toolkit in Visual Studio 2017

We must use Visual Studio 2017 (any version) to create a Blazor application. We can install AWS Toolkit in Visual Studio 2017. There are a couple of ways available to install this plugin.

Open Visual Studio 2017 and click “Extensions and Updates” from “Tools” menu.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
Search for “aws” from the “Online” tab. You will get the below results.
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 

You can choose “AWS Toolkit for Visual Studio 2017” and click the “Download” button.

It will download the plugin.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
After some time, the plugin will be downloaded successfully. We can close Visual Studio 2017. After closing the Visual Studio, AWS toolkit installation will be started automatically. Click “Modify” button to install the plugin on Visual Studio.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
After some time, the installation will be completed successfully.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 

In a second way, you can directly download the plugin and install to Visual Studio. We can open Visual Studio and create a Blazor application.

Open the existing Blazor application for getting C# Corner RSS Feeds.

Here, we are using an existing Blazor application. I am using a Blazor application which will display the RSS feeds from the C# Corner website. I already discussed about this Blazor application in my previous post. Please read this article to get more details about that app.

Publish app to AWS Elastic Beanstalk
 
Right-click the “Server” project and choose the “Publish to AWS ElasticBeanstalk” option.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
We must create a profile to proceed with further steps. Access Key and Secret Access Key are very important.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
You can obtain these details from the AWS Console. Log into AWS Console and click “My Security Credentials”.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
You can click the “Access Keys” tab and click “Create New Access Key” button to create a new Key Pair. After creation, you can download this key pair for future usage. Please keep these keys safe. We can create multiple access keys. If you find a misuse of these keys, immediately delete/inactivate these keys.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
We can enter these keys to profile and create the profile. Click the "Next" button to proceed with further steps.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
We can choose the environment and give a URL name. Please check the availability of the URL.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
Click “Next” button to proceed with further steps. We can choose the Container type and Keypair. You can opt with existing key pair (if it exists) or create a new key pair.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
We can choose the required permissions and roles. Here, I am opting for default roles only.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
In the final stage, we can choose the build configurations (Debug/Release mode) and click “Finish” button.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
Before starting the deployment, you can review the existing steps and values given.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
Click the “Deploy” button to start deployment.
 
You can monitor the deployment status on Visual Studio itself.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
You can even monitor the deployment status on the AWS Console too.
 
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
After some time, our application will be deployed successfully and ready to use.
Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 

We have successfully deployed our Blazor application to AWS Cloud using Elastic Beanstalk.

Now, we can open the URL and run the application.

Deploy Blazor Application On AWS Cloud Using Elastic Beanstalk 
 
You can see that “ap-south-1" is additionally added to the URL. Here, I am using the Mumbai region in AWS. If you choose another region, you will get a different URL.

Demo application is hosted in AWS.

You can open this URL to check our Blazor application.

Conclusion

In this post, we have installed AWS Toolkit plugin in Visual Studio 2017, and we have published one Blazor application to AWS cloud using Elastic Beanstalk. For that, we have used the existing Blazor application for getting RSS feeds from C# Corner feeds.

We can see more exciting features of the Blazor framework in upcoming posts.