How to Deploy .Net Application to AWS EC2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in this video we are going to see how to deploy dotnet applications to amazon ec2 instance so we'll be deploying uh the dotnet application from visual studio using web reply so we'll see how to provision an instance and how to configure it for web deploy to work so i'm in the aws management console now so let's quickly provision an ec2 instance so as i'm deploying our.net framework application i'll select windows server 2019 base ami for this one i'll go with t2 dot micro instance i keep the rest of the options as default so for security group i already have an existing security group just make sure whatever security group you use you have the inbound traffic open on port 80 and for rdp you need port 3389 enabled and for this one currently i have made it open for the rest of the ports as well so and just select an existing key pair i have so if you don't have you can just create your new key pair which is used for decrypting the password and hit the launch instance so my instance is now launching so it may take three to four minutes for the instance to launch and for password option to be enabled so i just pause the video till then so my instance is now running so just connect to it use an rdp client a remote desktop so this one first i have to get the password and for that i need to supply the file which i selected i just select it and decrypt password let's just download the rdp file just copy and note this password down somewhere and we'll now connect to our instance so like before like deploying the application we need to get the instance ready we need to install the few things so we are going to do just that right now so in your virtual machine you can just go to server manager and so just one point to note like whatever steps i'm going to do now like it's not anything specific to maybe aws ec2 instance so i can use any virtual machine running on windows server and i can perform similar steps whether it is in aws azure or google cloud or any cloud provider so basically the steps might be the same you need to install the same things uh one more thing i might show you like we need the microsoft web deploy agent installed on this machine so just search for microsoft web deploy so you get this link web deploy 3.6 so you can open this link in the virtual machine also and install this extension or or you can just download it the x64 version so it's already downloaded in my desktop so what i can do is i can just copy then i can just paste it in my virtual machine which i provisioned by the time it is copied that so open server manager and we have to add click on add rules and features click on next we go with role-based feature-based installation let's select the local server and here's just select web server iis the cat features and this one make sure you have a dotnet 4.7 selected click on next in the set now in this screen you get we have to make sure the few options are selected so so in the security make sure you have basic authentication selected and then go to application development so you have dot net extensibility 4.7 by default select some other features also you also make asp.net 4.7 selected here and also select the management service that you see here let me just go to so make sure everything is selected just click on install so it might take some time to install you can see it is starting the installation so let me pause the video for the timing so as we can see the installation is now succeeded let me just close this window and please install this web deploy file which i copied earlier just double click on it and just select complete so all the features are installed so you just wait for it to be installed it's not installed so what we'll do right now is just uh reboot this instance once let me just log off from the instance go to the management console i just select reboot instance and so it might take a few minutes for it to be rebooted we just give it a few minutes so my instance is now rebooted and i have logged into the instance again and just to make sure go to run command and type inet mgr so you can see that the is manager is now installed we are in the web console just to double sure that you are able to connect your instance to http what uh i'll do is i just copy the public ip address let's just try to hit it and you can see we are getting the default iis page you can see our eyes is now running successfully so we just need to configure it a bit more so just select the machine name here select the management service and make sure you this enable remote connections is selected if it is not then probably you can just stop this service just enable it again and apply and start the same this is very essential make sure this is selected and checked other thing what we'll do is just go to authentication and make sure basic authentication is enabled just enable it this is enabled as well just refresh now i'll go to the sites just delete this default website for the timing and what we'll do is we'll add a website let's just name it my sample app in the physical path we just create a new physical folder and create it inside c drive i net pub www root create a new folder and name it my sample app this is selected and we'll be running on port 80 only so just click on ok you see your site is ready so so for web deploy what we can do is just right click you have a deploy option here this is due to the web deploy agent we installed and we'll select configure web deploy publishing so by default it is going to give you some of the options and please generate a file just click on setup if you see it has published enabled for admin user it has granted ios manager permissions on this one and if i go to the close now and go to the desktop it has already also created a publish file which we can use so now what we do is we open visual studio and just try to deploy and sample application from there so i have used studio running i just create a new project is select.net framework application and i'm running a visual studio 2019 but you can follow the same on any other version as well application i'd select autonomous framework for 0.7.2 and select mvc from here leave this configure for https unchecked for the time being just for this demo let me just create this project so the project is now created so we're not going to make any changes to it so so by default it will just launch a default mvc page which we get let's just quickly have a look this is the default page which we are going to deploy to our instance so what we can do is just you can just right click on it select publish and yeah before that i just let me just connect to just connect back to the instance somehow it got disconnected copied the password i just copy this file from this machine i copy it to my local machine it is there so so in my visual studio what i do is in the publish option you can just import profile in the import profile you just go to desktop where i copied that file and just select this file so this will import the settings that is required to deploy it to that is folder so we just have to make some changes so what you need to do is like go to this machine and just copy the ip address so in this one just replace the machine name you see with the ip address whatever you see and the password that you copied the machine password just place it in here so now let's see just try to validate the connection if you get such such message just click on accept and we can see it uh check mark the connection succeeded just make sure you have used the correct ip address here that will be the default site name which we created that name username should be administrator because if you remember we granted this user permission to deploy and the password just save password here also and just click on next i just select configuration as release and i'll save it so my settings are updated so let's try and publish it you can see the publishing has now started and the publish has now succeeded so it will automatically launch a browser window so we'll just try to connect to that instance again and see what happens now may take a few minutes to initialize as we are running it for the first time and yeah as you can see now going to that url we are now getting the default asp.net so we can see our mvc application has now been deployed through visual studio and just to confirm i'll go back to the instance and if you remember we created our folder in c drive and network www root this is inside this folder if you see my contents or my mvc application has been copied and deployed here it's running as well and if i want to do any changes also so let me just change the default view just change it to running you can just save it and then let me just publish it again so it won't take this much time now because already initially we have deployed it once and now you can see if just copy and paste this url again as you can see the changes have now been deployed also and i can make any changes and you can directly from visual studio i can deploy and publish it here as long as my settings are correct so this is the way we can deploy to amazon instance ec2 instance using this but yeah as i said earlier like this will work for any instance in which you have windows server installed so it's not anything specific to aws cc2 you can have any server running on windows server 2019 2016 and on and you can do similar settings to make it configurable so now my instance is done so i can just go and terminate it and okay thanks for watching the video if you like it just subscribe to it thank you
Info
Channel: Coding Paradox Tutorials
Views: 8,070
Rating: undefined out of 5
Keywords: AWS, Training, Cloud Training, AWS Tutorial
Id: UBOz6vrO4VU
Channel Id: undefined
Length: 20min 11sec (1211 seconds)
Published: Tue Dec 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.