Showing posts with label Visual studio online. Show all posts
Showing posts with label Visual studio online. Show all posts

Monday, January 12, 2015

Application insights in VS online and Azure

With ASP.NET application Insights it’s now very easy to collect operation, performance and usage information on your ASP.NET web applications. With the data provided by application insights you can quickly detect and act on performance and availability issues.
You can add application insights to your project from visual studio with the combination of an Azure account. Application insights option can be added when you create a project like given below (You'll need to sign up using a Microsoft Azure account)

For existing web applications, you can also choose to add the script to enable insights at a later point of time. Follow the steps given below to get the code to add insights.
  • Login to the Azure portal and choose add application insights option

  • Provide the name of the site and configure the resource group and subscription details.

  • Choose Add code to monitor web pages option

  • Get the script and insert the code in your Layout page or master page as given below.




  • Open the portal to see the insights in your dashboard.


Thursday, January 1, 2015

Setup CI build on VS Online - Hosted build controller

With your VSO account and team projects created using the account, it’s very easy to have full ALM capabilities integrated to your project. Once you have chosen the version control for your project you can easily hookup a build definition and create CI builds using the hosted build controller provided as part of VS online.
If you are using the hosted build controller, there is no need of any additional hardware resources that needs to be installed or configured for setting up a CI build.
From VS online open the project in Visual Studio and then connect to the team project by selecting the VS online account server as shown below.

Choose Builds to add a new build definition for the project and create a new build definition

One the new build definition screen, give an appropriate name for the build definition.

On the Trigger tab, choose Continuous Integration as the trigger
Setup the source location based on the type of version control used. In my example, we have used Git as the version control system.

On the build controller screen, choose the Hosted Build Controller option. This is the build controller provided as part of VS online and can be used for most of the common scenarios. Refer to this link to see if you need a separate build controller instead of the hosted build controller.

Configure the project to build and other options in the process tab as given below.

Save and close the build definition.
Open the solution in your visual studio and to make some changes to the project
Commit the changes to the master repository (You can check-in) in case of TFS.

After committing, you need to sync the changes to the Git server.

On your VS online account build page or the TFS explorer you can see the CI build queued as soon as your check in done.

Once the build is completed you can check the status and details of the build from the completed tab as given below.


Next we’ll see how to setup your build server on an Azure VM and use that build controller instead of the hosted build controller.

Tuesday, December 30, 2014

Code online with Monaco in VS online

One of the most interesting and new features of Visual studio online is “Monaco”, the online code editor. With Monaco, you get a free, lightweight online code editor that is accessible from any device or platform and allows you to perform almost any tasks that can be done from a VS IDE.
To access Monaco follow the steps given below.
  • Open the Azure management portal
  • Click on websites and choose your website, which you want to edit using Monaco

  • Scroll down to the till you find the extensions tile on the website configurations section.
  • Click on the extensions and choose to add the visual studio online extension

  • After adding the extension, browse to see the code on the portal


  • On the let navigation panel, choose the Git icon to clone the vs online repository from the Git repository

  • Start editing the code from the browser.
  • After editing you can see the Git notifications for the changed files.

  • Click on this icon and commit the changes
  • Publish the changes and access the website to see your changes live!!!!



Sunday, December 28, 2014

DevOps world with visual studio online - Part 1

With visual studio online, you can easily host your code in the cloud, access it anywhere and support a variety of development platform. You can easily setup the cloud infrastructure using VS online in a couple of minutes without having to setup the server infrastructure. It also allows you to choose the version control system to host the files (Centralized – TFS or Distributed – Git), manage the project in the cloud by planning and tracking work items with fully integrated tools for agile planning and portfolio management.
To create a project and create a master branch in Git, you can create a new repository at a file location either by using the Git Bash or Git Extensions as given below.

Once the repository is created, you can now go ahead and create a project in visual studio at the location. You can also choose to host the site on cloud if needed and test the application.





After creating the project, next step is to add the files to the repository. You can use the git add command to add the files to the repository before committing it. Its also good to add a .gitignore file to the repository to mention the details of the files that you don’t want to include in the repository.
If you check the status of your repository at this point. It should look something like:

Once the git ignore file is created, you can add and commit the files to the master branch using the "git add ." and "git commit -m "my commit message"" commands
After commit your repository structure should look like

Once you have your master repository created in your local machine, you can now setup a remote git repository by using the command.
git remote -add origin "your vs online project url here"
To create a VS online account, you can either use the Azure management portal or use the Visual studio online website. I've used my Azure portal to manage my VS online account.
After successful creation of the account, you can create a new project in VS online and use the version control of your choice as given below.

To push the local repository contents to this remote repository, you need to use the git remote command and then push the contents to the remote repository.

Once published, the source code can be viewed from your VS online profile.

Next we’ll see, how to branch this, create builds, tests and deploy to Azure all using VS online.