Thursday, December 22, 2016

ASP.NET Core Application continuous integration with visual studio.com and git

Previously I have written couple posts for continuous integration series and this post is also part of it. Recently Microsoft has released ASP.NET Core 1.0. So in this post, we are going to see how we can do the continuous integration for ASP.NET Core application. I am going to use visualstudio.com as our source control repository and git as our version controlling system. So Let’s get started.

The first thing we need to is to create a Project into VisualStudio.com like following.

VisualStudioProject

Once you click on create the project it will create a project with GIT as version controlling system.

naviagte-to-project

Now our project is ready. Once you click on navigate to project it will load project dashboard like below.

project-dashboard

Now go-to “Build & Release” section of the project. It will load the page like below.

build-release-visual-studio-com

Now to enable continuous integration for this project we need to create a new build definition for that click on Plus green icon on left side. It will load a wizard to create a build definition. The first screen presented with default templates like below.

build-definition-wizard-template-selection

We are going to select ASP.NET Core build which there in preview mode and click next will load source control step like below.

build-defintion-git-settings-step

Her we are using visualstudio.com so we are not going to change anything but we are going select continuous integration check like below to enable continuous integration like below.

build-defintion-git-settings-continuous-integration

Click on create will create build definition like below.

build-definition-wizard-completion

Click on save button to save build definition. It will open up a dialog like below.

core-build-definition

Click on ok will save build definition.  Now we are done with the configuration of continuous integration and now its time to add code to check whether this configuration is working or not. To add code click on the code menu on visualstudio.com it will load the following screen.

git-code-page-visualstudio

Now to configure the repository in visual studio we need to click on the clone in visual studio. It will open Visual Studio IDE.

team-explorer-visual-studio

Clicking on clone will clone repository in local and then we need to create an asp.net core application for that repository.

create-net-core-application

Clicking on open will create an asp.net core web application. Once you are done with creating the application, we need to push our code to master branch so that we can see whether our continuous integration is working or not. To push the changes, Goto team explorer it will load screen like below.

team-explor-visual-studio-after-create

Click on changes will show the changes that are made for git repository like below. Put commit message and click on commit all.

changes-team-explorer-visual-studio

It will commit changes local like below.

commit-local-team-explorer-visual-studio

Now click on sync. It will load Synchronization screen like below.

sync-screen-team-explorer

Now click on push button to the push committed changes to the remote git repository.

pushed-changes-visual-studio

It will push changes to the master branch. Now to check continuous integration go to build definition section of visualstudio.com. A build should be queued up for the changes we have made like below.

build-queued-up

After some time if your commit changes are fine it will complete the build.

completed-build-visual-studio

So you can see that our continuous integration is working fine. It’s pretty easy to setup. Hope you like it. Stay tuned for more.
Share:
Tuesday, December 20, 2016

How to enable remote desktop on Azure Linux VM

In Windows Azure Linux VM there is no direct way to remote desktop Azure VM. So in this blog post, We are going to learn how we can enable the remote desktop on Azure Linux VM.  If you don’t know how to create a Linux VM then there is a ton of articles available that how you can create a Linux VM.  Following a Microsoft, Docs links for creating an Azure Linux VM.

https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-quick-create-portal

After creating a new Linux VM, the first thing you need to have SSH Client to connect the Azure VM. I have windows machine and Putty is one of most well known SSH client for the windows. So If you don’t have SSH Client download Putty from the following link.

http://www.putty.org/

Once you create a VM you will get any public IP like following.

azure-linux-vm-public-key

So copy that public IP and then open Putty and paste the public IP like following.

putty-client-for-linux-vm

Now once you are done with it click on open button. It will ask for your username/password. The key thing to remember here when you create Linux VM you have selected username and password. If you have a public key then you need to supply that key to Putty.

login-password-for-putty-azure-linux-vm

Once we got connected, We need to enable the gnome desktop in our Ubuntu Server first we need to get the latest update of it and for that, we need the following command.

sudo apt-get update
Once the update is done.  Now It’s time to run install ubuntu-desktop command.

sudo apt-get install ubuntu-desktop
It will enable the Remote Desktop and Desktop UI to Ubuntu Server VM.

Note: Here I have created a Ubuntu server in Azure Linux VM. But you can use any flavour of  Linux available in Azure VM. There will be different command for each flavour you can find the complete list at following location- https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-classic-remote-desktop
Once you run the command it will take some time for running and installing desktop for the server.

update-linux-vm-install-desktop

Now its time to install remote desktop in the server for that you need to run the following command.

sudo apt-get install xrdp
Once done with that try to remote login with Windows Remote Client.

image

Note: Sometime you  now allow the remote connection that is because with Azure VM default port is not allowed for remote desktop. So for that goto the following page and do as said to allow remote tcp ip port- https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-troubleshoot-rdp-connection
And I am able to login to my Azure Linux VM.

image
Share:
Search This Blog
About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews