-
Notifications
You must be signed in to change notification settings - Fork 1
#62_Running_ASP_dot_NET_on_AWS
Shane Vincent - 03/04/2019 Nhi Nguyen - 03/04/2019
There are several systems that we could use to run .NET core on AWS. Any selected must meet these requirements:
- Must be able to run .NET Core
- Must have support for .NET Core identity
- Must be able to get access to a web server and database
Have decided to use AWS Elastic Beanstalk
- Can run .NET Core
- Apps running on AWS Elastic Beanstalk can be made with Cognito
- Can run coupled with AWS RDS (database) and a web server
- Hosting a .NET application on AWS
- Setting up the AWS toolkit for Visual Studio
- How to deploy a .NET application to Elastic Beanstalk
How to setup an AWS Elastic Beanstalk server: Requirements:
- An AWS account
Costs:
- Cost estimate is $0.09 to setup the server, assuming we follow the recommended configurations, and that we terminate all resources within 1 hour of completing the project.
- It is predicted to cost roughly $53 to run the server constantly for a month.
-
Open the Elastic Beanstalk Console
-
For Platform, select .NET from the dropdown.
-
When setting up a sample environment, I setup a Sample application as the Application Code. Here, it is possible to upload our own .NET code.
-
Click Review and Launch.
- Select Modify under the Database tab.
- If loading from a database snapshot, select that from the Snapshot dropdown.
- Enter a Username and Password.
- If you plan on loading this database again in the future, select Create Snapshot from the Retention dropdown. Otherwise, select Delete.
- Click Save.
- Click Create App to create the environment
Creating the environment will take about 10 minutes to complete. Once it is completed, the environment information that is displayed at the top of the page will reveal the URL of the web server that is running: (here)[http://tutorials-env.xg7ncc92bz.us-east-2.elasticbeanstalk.com]
Navigate to the URL and this message will be displayed if the server is running successfully:
Code can be uploaded and deployed straight on the web interface or can be deployed through the AWS toolkit for Visual Studio.
- Go to aws.amazon.com and login.
- Select Elastic Beanstalk from the Services tab.
- Click on the environment that is running.
- Click on the Upload and Deploy button.
- Select a source bundle you wish to upload and give it a label. In order to create a source bundle, follow the instructions here
- There are more options available under Deployment Preferences. Investigate them to see if they are anything you are interested in when deploying.
- Click on the Deploy button.
- While the application is deploying:
-
Download and configure the AWS Visual Studio Toolkit
-
In Visual Studio, open your project.
-
On the View Menu, choose Solution Explorer.
-
Expand the Solution of your project.
-
Right click on your App and then select Publish to AWS.
-
On the Publish to AWS Elastic Beanstalk page, for Target Deployment, choose the environment that we have created, then click Next.
-
On the Application Options page, accept all of the defaults and then choose Next.
-
On the Review page, choose Deploy.
-
After deployment, the Output box displays feedback.
-
Check the Elastic Beanstalk Console to see if the application was successfully deployed.
If you wish to terminate the environment. If you are interested in saving the database in a snapshot, ensure that in the configuration of the database it is set to be snapshotted, rather than deleted.
- Go to the Elastic Beanstalk Console
- Click on the Environment
- Click on Actions and then click Terminate Environment.
About
Documents
-
AWS
-
Other
-
REST
-
Nectar
-
Rancher
-
ASP.NET
-
Data
-
Blockchains
-
Processes