AWS - Retrieve logs from my .Net Core App - amazon-web-services

I have used AWS Elastic Beanstalk to deploy a simple .Net Core app to a Windows INstance. However it is not working on AWS as it is working on my local machine. I am getting a 500 Internal Server Error but I cannot see the message/stack trace.
Trying to get the logs, I have followed this documentantion, I have logged into the EC2 instance but my application is not deployed to the inetpub\wwwroot and the logs on the C:\Program Files\Amazon\ElasticBeanstalk\logs\ are about the deploy.
How can I find out what is wrong with my application?

Related

How to automatically deploy asp.net core application to ec2 instance using jenkins?

I have hosted an ASP.NET Core web application on an EC2 instance using Nginx. The EC2 isntance is running on Ubuntu Server 16.04 LTS machine.
I am developing the code in windows machine and publishing the code. Then copying the files into the EC2 instance using WinSCP. The web application is running nicely and i can hit the application using postman or browser.
Now, i have decided to use jenkins for CI/CD. I have installed jenkins in the same ec2 server where my web application running. Jenkins is running in port 8080 and my web application is running in port 80. I have configured jenkins with my bitbucket repository by following this link.
Now, my jenkins server is up and running. If i commit anything in the bitbucket repository, jenkins server automatically triggers a build.
Previously, i have published the code using below command:
dotnet publish -o my-sample-site
And then copied the files from my-sample-site directory to the directory in EC2 instance. Now, i want to automatically build the asp.net core web source codes and publish the codes to the folder where my web application is running. I may have to restart the service also after changing the codes.
What should i include in the jenkins build step so that whenever bitbucket repository changes triggers build in jenkins, it will build the asp.net core source codes and then publish the codes in the directory of the EC2 instance where my web application is running.
How should i do this automatically? Any reference please. Thanks in advance.
I have set up CI/CD server using Jenkins connected to a Bitbucket repository for an ASP.NET Core Web API running in an EC2 instance. Anyone can check my article here.

Deploying a web application for Selenium testing on AWS EC2

I have a web application that uses Selenium in backend to run few scripts when invoked by user. I want to deploy this web app on AWS.
Here are my findings so far:
I can have a windows EC2 instance created and then I can install tomcat, firefox and all the necessary stuff. Then using putty or any other client, I can deploy my war and start tomcat.
I can directly make use of Elastic Beanstalk and deploy my war file there itself but then, there is no windows EC2 available for beanstalk and I don't know how to install firefox there and make my application work.
What is the best way to achieve this and what steps should I follow. I want to install a specific firefox version to be able to make it run with my selenium scripts.
There are two separate things here:
Deployment of web application on AWS cloud
Run the selenium tests against your web application
According to me, you should first think of deploying a web application to AWS cloud. There are many ways by which you can get it deployed to AWS cloud with below services:
Spin a new AWS EC2 instance, install all required software and deploy the web application.
Use AWS elastic beanstalk service with either with tomcat or docker.
Use AWS ECS if you prefer docker
According to me, second option will be quick for you with tomcat environment option. If you select tomcat environment, then your platform will be Tomcat 8 Java 8 on 64bit Amazon Linux.
Now, here comes the second part. You can have below options for your browser environments.
Spin a new separate AWS EC2 instances with correct AMI and install your specific browsers on these instances.
If you prefer SaaS, then you can take a look at browserstack or SauceLabs for remote environment.
If you have CI(jenkins/travis/Circle CI), then make use of that infrastructure to luanch your tests with either option from the above.

Spring Cloud Config Server requires restart on AWS

I am running a spring cloud config server through AWS Elastic Beanstalk. Everything seems to work fine, but after some time (around 2 weeks) I encounter problems accessing the configurations. I get the error
Loading configuration failed
without further details on the "Whitelabel error" page of spring boot (when accessing the configuration through the browser; access through client just times out).
When I restart the config server instance on Elastic Beanstalk I can access the configuration normally again (no repository/code changes, just restart).
I suppose this is not expected behavior - I don't believe there is a "timeout" on the config server after which a restart is required.
Could it have something to do with AWS?

awseb cli inconsistent with AWS web console

I am new to AWS. I am trying to setup AWS Elastic Beanstalk. I am using cli.
I followed a youtube tutorial(https://www.youtube.com/watch?v=xhc1boyBkJw&t=317s). The problem is that at the end of tutorial I see "INFO: New application version was deployed to running EC2 instances.
INFO: Environment update completed successfully." success message in terminal. But when I open AWS console in web browser, I see 0 instances running and no beanstalk environment setup.

How to setup AWS elastic beanstalk with windows server 2012

I'm new to AWS setup, and after having put quite a lot of time into researching an easy way to setup an instance on AWS for a .NET application, I finally decided to go with Elastic Beanstalk.
After creating an elastic beanstalk application (sample application), I need to upload my files and DB to that application and access it via an URL.
I haven't found a simple straight forward tutorial showing this. If someone has links to tutorial websites or have got this done, would like you know the process.
I've created a security group and added a keypair. Do i need to access it via SSH and install FTP and so on?
Help is appreciated.
-Adi.
There are some tutorial videos on .NET development and AWS Elastic Beanstalk available from the Amazon Web Services site here:
https://aws.amazon.com/visualstudio/