Showing posts with label vsalm. Show all posts
Showing posts with label vsalm. Show all posts

Tuesday, March 14, 2017

Build: minutes are back

If you have activated the new Account Home Page on your Visual Studio Team Services, you should have noticed that the free build minutes counter is not anymore there. Not only: it is not present in the home page, nor in any other pages and sections.

Finally, the counter is back. To see it, we have to go to the account settings, then Build and Release, Resource limits:


 Let's celebrate! Minutes are back :)

Tuesday, March 7, 2017

BugGuardian for ASP.NET Core

There is a new member in the BugGuardian family.

Quite a long ago, I've released BugGuardian, a library that allows you to automatically open a Bug or a Task work item on either Visual Studio Team Services or Team Foundation Server if your application experiences an unhandled exception. (Read more here)

After a while, two official extensions where released: BugGuardian.WebForms and BugGuardian.MVC. As the name states, they are targeting the ASP.NET WebForms and MVC respectively, making the adoption of BugGuardian even easier for who is using those platforms. But those 2 libraries have a limit: they only works with the traditional ASP.NET, running on the full .Net Framework.

Today, I'm very happy to announce that the BugGuardian.AspNetCore extension is finally available.

BugGuardian.AspNetCore is specifically written to support ASP.NET Core applications. It adds a Middleware to your application to let you automatically intercept all the exceptions.
And the good thing is that it supports projects with ASP.NET Core using both .Net Full Framework and Net Core.

You can find the source code (and all the information about its configuration) on GitHub here: https://github.com/n3wt0n/BugGuardian.AspNetCore

The package is also available on NuGet, here: https://www.nuget.org/packages/DBTek.BugGuardian.AspNetCore

Happy Coding :)

Tuesday, November 29, 2016

VSTS - RM & PM in GA, Search for a file and Microsoft Teams

This month we had not one, not two but even three feature release of Visual Studio Team Services!

I had to choose between so many new features to have my top 3 list this month, so it means that they are the very best.

Package Management & Release Management General Availability

Package Management now hosts NuGet and npm packages and helps you manage the lifecycle of your packages with new features like release views. It continues to offer best-in-class support for the latest NuGet updates and great integration with Team Build.

Packages enable you to share code across your organization: you can compose a large product, develop multiple products based on a common shared framework, or create and share reusable components and libraries. Package Management facilitates code sharing by hosting your packages, sharing them with the people you select, and making them easily accessible to Team Build and Release Management.
The Package Management extension is available in the marketplace

Release Management is also available in GA in VSTS and TFS 2017. Using Release Management, you can fully automate the delivery of your software all the way to production. It is an essential element of DevOps that helps your team continuously deliver software to your customers at a faster pace and with lower risk.

To use Release Management, first create release definitions and then configure environments and specify automation steps in each environment to deploy the software and run tests against it. You can set up automatic deployment to the environments as soon as the build is available to deliver value continuously to your customers. You can also configure approvals on each environment.

Search for a file or folder in commit history

Similar to the files tab, users can now search for a file or folder in a repository and see the history of commits for that file or folder. For any Git repository, go to the path control box on the History tab and start typing to initiate a history search experience for the file or folder you are looking for.



Microsoft Teams integration

Microsoft Teams is a new chat-based workspace in Office365 that makes collaborating on software projects with Team Services a breeze. Team Services users can stay up to date with alerts for work items, pull requests, commits, and builds using the Connectors within Microsoft Teams. Starting November 9, users will also be able to bring their Kanban boards right into Microsoft Teams.


Monday, November 28, 2016

WorkItems History: My first extension for VSTS and TFS

I'm very excited and proud to share with you the first version of my very first Extension for Visual Studio Team Services and Team Foundation Server: WorkItems History.


What
WorkItems History is an extension that adds a "History" hub to the Work section of VSTS/TFS and allows you to see the history of the added/modified work items.

Why
Working in a team is not always easy, especially when you need to have "things under control". With this extension, you can have a little more control of what is happening on your work.

Other info
I decided to release this extension as Open Source Software.
You can have a look at its GitHub page (https://github.com/n3wt0n/WorkItemsHistory) and, if you wish, you can contribute to the project. Please refer to Contribution guidelines and the Code of Conduct for more details.

Usage, support and Feedback
The extension is publicly available on the VS Marketplace, at this link: https://marketplace.visualstudio.com/items?itemName=DB.WorkItemsHistory

You can take a look at the GitHub repo to find more information on usage or installation of the extension.

If you encounter any issue using this extension, please let me know through the Issues page on GitHub and I'll fix the problem as soon as possible!

I'm waiting for your feedback :)

Thursday, November 17, 2016

Data and News from Connect(); 2016

On Wednesday, November 16, 2016, Microsoft demonstrated at Connect(); 2016 its vision of enabling the future of development with solutions that serve any developer, any application and any platform.

They have also shared some very interesting data about services and products adoption:
  • More than 20 million Visual Studio 2015 installs (with the free Community edition representing more than 14 million of those)
  • 1 million Visual Studio Code monthly active users (MAU).
  • 4.6 million registered Visual Studio Team Services users
  • More than 25,000 developers from 1,700 companies have contributed to .NET Core and related open source repositories, with nearly 2/3 of the contributions coming from outside Microsoft.
  • 1 million Visual Studio Dev Essentials members
  • Half-a-million more Xamarin users since the acquisition, a 3x increase over the company’s previous growth rate.
  • 20,000- registrations for the SQL Server on Linux private preview, including over 50% of the Fortune 500.
  • 1.6 million Azure SQL Databases in the cloud and over 100 billion queries per day
  • More than 120,000 new Azure subscriptions/month
  • Approximately 1 out of 3 VMs on Azure are Linux
  • 35% month over month growth of Microsoft Graph in past year.
  • 47,000 active third party applications built using Microsoft Graph and more than 1 billion API transactions on Microsoft Graph
  • More than 400M Windows 10 devices
  • The Windows 10 Cortana search box now has over 141 million monthly active users
Brian Harry has written a very good blog post (read it here) with all the announcements about TFS and VSTS. Take a look at it!


Monday, October 31, 2016

VSTS - Scheduled release, Azure and XCode build

One more month, one more exciting release of Visual Studio Team Services.
These are my top 3 new features of this month:

Multiple schedules in releases

Want to schedule your releases to be created more than one time in a day? You can now configure multiple scheduled triggers in a release definition.



Simplified Azure endpoint creation

In an earlier sprint, VSTS team made it easier to create a new Azure Resource Manager service endpoint from Team Services. That experience only worked in accounts that are backed by an Azure Active Directory. In this deployment, they are bringing the same simplified experience for all the other accounts that are not backed by an AAD. So, if you are a MSA user and have an Azure subscription that you would like to deploy to from Team Services, you can create an Azure endpoint without having to run tedious Powershell scripts or following a blog.



Xcode 8 signing and exporting packages in the Xcode Build Task

The Xcode build task now supports building your projects using Xcode 8 automatic signing. You can install the certificates and provisioning profiles on the build server manually, or have the task install them by specifying the File Contents options.


Xcode 8 requires specifying an export options plist when exporting an app package (IPA) from an archive (.xcarchive). The Xcode task now automatically identifies the export method if you are using Xcode 8 or Xcode 7. You can specify the export method or specify a custom plist file from the Xcode task. If you are using an Xcode version older than Xcode 7, the task falls back to using the old tool (xcrun) for creating the app package.


Friday, September 30, 2016

VSTS - Manual deploy, Git imports and Queues

Here we are for a new episode of my personal "top 3 new VSTS features" series. Let's talk about September.

Deployment manual intervention

You can now pause execution during deployment to an environment. Including a Manual Intervention task enables you to pause a deployment, perform manual steps, and then resume further automated steps. You can also reject the deployment and prevent further steps from executing after a manual intervention.


You should note that a manual intervention task splits the overall execution into three phases. 

  • The first phase runs on an agent, and after it is done, the agent is released. 
  • The manual intervention phase does not require any agent. 
  • After it is completed, any tasks following the manual intervention task are run in the third phase, possibly on a different agent. The artifacts are downloaded during both the agent phases, since different agents may be used for both of them. You should not assume that the state from the first phase is available during subsequent phases.


Import Git repositories

We can now import a Git repository from GitHub, BitBucket, GitLab, or other locations, into Visual Studio Team Services. You can import into either a new or an existing empty repository.

To import into a new repository, from the repository selector drop-down, click Import repository. 


If the source repository is a publicly available repository, then simply provide the clone URL of the source repository and you are good to go.
However, if the source repository is a private repository and can be accessed using basic authentication (username-password, personal access token, etc.), then check the “Requires authorization” check-box to provide the corresponding credentials.


Instead, to import into an existing empty repository, on the Files page, click the Import repository button and provide the clone URL. You will need to provide credentials if the source repository is private and requires authentication.



Build queue tab

They've implemented a new design for the Queued builds page that shows a longer list of queued and running builds, and in a more intuitive fashion. Looks good...



Friday, August 26, 2016

VSTS - Files, Details and Folders

In august there's been only one update to Visual Studio Team Services. Let's take a look at my 3 favourite new features for this month.

Pull requests Files

The biggest new feature in this release is the ability to see past updates made to a pull request. A few sprints ago (July 7th), they released the ability to properly track comments as a pull request is updated with changes. However, it’s not always easy to see what’s between updates. In the Files view, you can now see exactly what changed each time new code is pushed to your pull request. This is really useful if you’ve given feedback on some code and want to see exactly how it changed isolated from all of the other changes in the review.



Improved build details

When you click down to focus on a specific build, it now gives you a lot more information about what's happening and overall code quality. 




Build Definition folders

Does your team have a lot of build defintions? You can now use folders to keep them organized in the All Definitions tab.



Tip: Have a batch of definitions that need the same permissions? Put them in a folder and then you can give permissions to the folder


Tuesday, August 2, 2016

VSTS - Azure, Comments & Redeploy

Here we go with my 3 favourite new VSTS features for July.

Release management - Azure deployments

Now, setting up an Azure Service endpoint is easy: you just need to select the subscription on which to create a service endpoint, and you are ready to deploy to Azure.


  • Users can now automatically set up an ARM service connection by selecting the subscriptions linked with the Azure Active Directory that is backing the VSTS account.
    • Note: A new Azure Service Principal will be created and assigned the Contributor role, having access to all the resources in the selected subscription. You can modify the Service Principal access from Azure portal > Subscriptions > Users > Roles.
  • Prerequisites: -The VSTS account should be backed by an Azure Active Directory. For more info, see the Visual Studio article Team Services: Access with Azure Active Directory (Azure AD).
    • Note: Only Azure subscriptions that are linked with the Active Directory are listed.


Comment tracking for pull requests

Pull requests in VSTS have been improved to show comments left in files on the proper line, even if those files have been changed since the comments were added. Previously, comments were always shown on the line of the file where they were originally added, even if the file contents changed—in other words, a comment on line 10 would always be shown on line 10. With the latest improvements, the comments follow the code to show what the user expects—if a comment was added on line 10, and two new lines were subsequently added to the beginning of the file, the comment will be shown on line 12.
Here's an example change with a comment on line 13.


Even after the code has changed to shift the line with the original comment from 13 to 14, the comment is appearing in the expected place (line 14).


I think this improvement is a big step forward for improving the code commenting experience in pull requests. In the near future we will have even more improvements coming, including improved comment placement for renamed or moved files.


Release – redeploy after success

When a deployment to an environment fails, you may want to be able to redeploy an older release that already succeeded once in that environment. This feature lets you do just that. 

When you try to redeploy an older release, you will be shown the list of commits as well as the list of work items that will be rolled back. You just need to make sure that the automation scripts for deployment can really handle the rollback scenario. That is still on you.


Tuesday, June 21, 2016

VSTS - SSH, Docker and Tokens

Another month, another update for Visual Studio Team Services! (To be honest, there have been 2 updates in June :) )
This is my favourite 3 new features:

SSH clients can connect to Git repos

Team Services Git repos now support SSH connections. This makes it easy for many development tools, build systems, and other services to connect, especially if you develop on Mac or Linux. You can get the SSH clone URL for your repo from the Clone button on the web, and also manage SSH keys on your profile page.


SSH has been enabled on all existing accounts. For the next sprint, SSH won't be enabled on new accounts until a few hours after the account is created. That restriction will go away shortly.

Docker integration for build and release management

Take advantage of the VS Team Services cloud-based build capabilities to build your Docker images and upload them to the Docker Hub as part of your continuous integration flow. Then, deploy those images to a number of Docker hosts as part of Release Management. The Marketplace extension adds all the service endpoint types and tasks necessary for you to work with Docker from VS Team Services.



Release – Passing oauth tokens to scripts

You might often need to run custom PS scripts in Release Management, which invoke REST APIs to create work items or query for more information about a build. You can now check an option in the environment to make a Visual Studio team Services OAuth token available to such scripts.


Here is a simple example on how to get a build definition:
$url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/build/definitions/$($env:SYSTEM_DEFINITIONID)?api-version=2.0" Write-Host "URL: $url" $definition = Invoke-RestMethod -Uri $url -Headers @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" } Write-Host "Definition = $($definition | ConvertTo-Json -Depth 1000)"

Wednesday, May 11, 2016

VSTS - New features for Build & Release

Microsoft has published a new feature set for Visual Studio Team Services which brings some very interesting new things to the tool.

Build and release summaries

There are two new bits of information that will show up on the build and release summaries. 
First, you’ll notice that console logs are now available in the Test pivot. Console logs are published as test result attachments and can be previewed in the Tests tab in the Build summary and Release summary panes.


Second, it’s very common to need to understand and identify test cases or containers that take the most time to run. You can now find this information by sorting the Duration column in the Tests tab in the Build/Release summary panes. In addition to the duration of individual tests, you can also look at aggregate duration of test containers or test runs by grouping by the respective pivots.


Release Management improvements

This release brings with it quite a few Release Management (RM) improvements. Let’s walk through the new capabilities…
First, Release Management now supports linking repositories (both Git and Team Foundation Version Control) as artifact sources directly to a release definition, enabling you to consume resources in your repos without having to publish build artifacts with the same files. Note: There is no support yet for auto-triggering new releases when a commit is made into these repositories, but that work is in flight, so stay tuned.



Additionally, you’ll find these new features:
  • Copy, Export, Import. A new extension has been published in the Marketplace that lets you copy, import, and export release definitions.
  • Schedule Based Deployment Condition. You can now configure a condition on an environment to pick up the successful deployments (or the latest one) from another environment and promote them at the selected time. This capability allows you to have time-based deployments that happen on a repeatable schedule. Chose the Deployment Condition tab in your environment to configure the schedule.
  • Release Management REST APIs. You can now use the REST APIs for Release Management service. They are published at: https://www.visualstudio.com/en-us/integrate/api/overview. Most of these APIs work with the on-premises releases of RM features in TFS 2015 Update 2 as well (changes between TFS and Team Services versions are indicated in the API docs). 
  • Simplified Release Definition Wizard. The wizard to create release definitions has been simplified. You can enter most of the inputs to setup a definition with a single environment in this wizard. They have also simplified the process for adding more environments into a definition or to clone an environment. 
  • New Job Execution Variables. Below are a set of variables now available that let you access information about artifact sources when executing deployment jobs. These variables are available in the format: RELEASEARTIFACTS_. represents the artifact source that is included in the release definition. You can find the name of the alias in the Artifacts tab of a release definition. 
    DEFINITIONID BUILDNUMBER BUILDID REPOSITORY_NAME SOURCEBRANCH SOURCEBRANCHNAME SOURCEVERSION BUILDURI REQUESTEDFORID REPOSITORY_PROVIDER REQUESTEDFOR TYPE
    Note: For scripts, replace the underscore with a period.

Friday, April 29, 2016

About Xamarin build with VSTS Hosted Agents

Last friday (22/04/2016), during an event organized by DotNetToscana, I had a talk about the build of Xamarin apps with Visual Studio Team Services' Hosted Agetn 

To make the build works, I had to add two tasks to manage the Xamarin License to the build definitoin: one to activate the license and another one to deactivate it after the build operation. 

There is a small (and big at same time) news about these two tasks: they are no more required now
Indeed, with the most recend update of the VSTS platform, the Hosted Build Agents have already an internal Xamarin license which is automatically activated when they have to perform some build opreations against Xamarin projects. 

So, to sum up, if you have or want to create a Xamarin build definition (and use VSTS Hosted Agent) now you don't have to add the license activation and deactivation tasks anymore. 

Have a good build :)


Tuesday, April 5, 2016

Introducing BugGuardian.MVC and BugGuardian.WebForms

Today I'm very excited to announce that I have released two additional modules for BugGuardian.

For who doesn't know it, BugGuardian is a library that allows to easily create a Bug or a Task work item on your Visual Studio Team Services account or on your on-premises Team Foundation Server 2015 in the case your application throws an Unhandled Exception.

To better support the integration of this library with web projects, today I'm announcing the availability of BugGuardian.MVC and BugGuardian.WebForms.

BugGuardian.MVC (GitHub, NuGet) is an extension for BugGuardian specifically written to support Asp.net MVC applications. 
It adds an Action Filter to your application to let you automatically intercept all the exceptions.

BugGuardian.WebForms (GitHub, NuGet), instead, is an extension for BugGuardian specifically written to support Asp.net WebForms applications.

They are based on the new BugGuardian version 1.3.0 and they support projects written with the .Net Framework v4.0 and above.

As it is for BugGuardian, these two additional libraries are OSS so feel free to see their code on GitHub.

If you encounter any issue using these libraries, please let me know through the GitHub Issues pages and I'll fix the problem as soon as possible!

Again, I want to thanks my friend and fellow MVP Marco Minerva (@marcominerva, GitHub) for the support and the suggestions.

Thursday, August 20, 2015

Welcome BugGuardian

Someone of you has maybe noticed the I did only few post in the last months. This happened because of two main reasons.

The first one is, as some of you already know, I moved in another country far away from home, with a completely different culture and language, to start a new adventure. This inevitably took a lot of time from the already small amount of spare time I have.

The second reason I wasn't so active here, that is also the reason of this post, is that I worked on a new project that I have released today: BugGuardian.

What is BugGuardian
BugGuardian is an Open Source library, written in C# like Shared Project, that allows to easily create a Bug work item on your Visual Studio Online account or on your on-premises Team Foundation Server 2015 in the case your application throws an Unhandled Exception.
It can also be invoked manually in try/catch blocks to keep track of handled exceptions.

It supports applications written with the .Net Framework v4.0 and above, and it can be used on every kind of project, including:
  • Asp.net
  • Asp.net MVC
  • WPF
  • Windows 8 / 8.1 Apps
  • Windows Phone 8 / 8.1 Apps
  • Universal App
  • Universal Windows Platform Apps (Windows 10)
  • and so on...

As I mentioned, it is OSS so you can find the sources on GitHub.

To let you install and use it without having to build the sources by your own, I have published it on NuGet. Just search for BugGuardian in the Package Manager GUI or run the following command in the Package Manager Console:
Install-Package DBTek.BugGuardian

Usage, support and Feedback
Refer to the project documentation to find examples about how to use this library. You can also find some code samples in the TestApps folder.

Anyway, just to make an example and to show it's really simple to use, this is the code you need to manage an exception and to open a Bug on your VSO / TFS:

using (var creator = new DBTek.BugGuardian.Creator())
{
    creator.AddBug(myException);
}

If you encounter any issue using this library, please let me know through the Issues page and I'll fix the problem as soon as possible!

I'm waiting for your feedback :)


I want to thank you my friend and fellow MVP Marco Minerva (@marcominerva) for the support, the patience and the Code Review.

Monday, July 27, 2015

Deploy a Web App to Azure with the Visual Studio Online Build

In this post we are going to see from sratch how to deploy a solution to an Azure Web App using the new Visual Studio Online Build platform.
To do it, we will use only the web portal of VSO.

Connect Azure to VSO
First of all we have to let Visual Studio Online know that we have an Azure account we want to use as deploy endpoint for our solution. Go the the Team Peoject Settings page (clicking on the button in the upper right corner of the project page), click on the "Services" tab, then on "Add new Service Connection" and then on "Azure".

At this point a pop-up will appear and we have to insert the ID of the Azure subscription which contains or will contain the Web App to publish, a name for it and the authentication mode.
We can use either a subscription certificate or the credentials.

When done, our Azure subscription and our VSO account will be connected (for this project).

Create the build definition
Now that we have linked VSO and Azure, let's go to the Build section of the project and create a new deployment build definition.


We eant to deploy to Azure, so in the "Deployment" section click on "Azure Website" (like shown in the image).

This creates a new build definition with some steps to configure.

Let's see how to proceed step-by-step.



The first one is the "real" build task. It's completely customizable but the most important thing is to define the solution file it has to use as build source. Select it like shown in the image, near the red arrow.

In the second step we have to set the how to execute the post-build Unit Tests. If we don't have unit tests (that is bad...) or we don't want to execute them (also this is bad :) ), we can safely remove this step using the "X" button that appears when the mouse pointer is over it.

The third step is the most important one for our scenario, because it publishes the build result to the Azure Web App.


In its settings there is a drop down where to select the target Azure subscription (if the previous Azure service connection worked properly). Then, in the "Web App Name" textbox, we have to write the name of the Web App we want to deploy. In theory this also appears as a drop down itself, but currently it doesn't load the existent Web Apps names (don't forget that the new Build platform is still in preview)

For this reaso, here I've written down some notes about the Web App name
  • If we use a non-existent Web App name, it will create it on our Azure subscription using the selected region
  • If we use a Web App name that doesn't exist in our subscription but which already exist in the selected region, the deploy process will fail
  • If we use a Web App name that already exists in our subscription but it is in a region different from the selected one, the deploy process will fail
  • If we use a Web App name that already exists in our subscription and it is in the selected region, the deploy will use it as target and will update it.


So pay attention about what we write :)

The two remaining steps allow us to index and to publish the application symbols (suggested, to have more information in the case of unhandled exceptions) and to publish the build artifacts somewhere.

When all the parameters are set we can go ahead and save our build definition, giving it a name.


We can also change all the default parameters in the upper tabs to customize the build process accordingly our needs.

Let's deploy!
Now that we have completed all the customizations, it's the moment to launch the build and to verify that the deploy works fine.

To start the build, click on the "Queue build" button in the build definition toolbar or in the contextual menu.



When we click on that button, VSO will queue a build based on our build definition and will execute it either on our servers or in a Microsoft Datacenter (if we have chosen to do it with the hosted agents).
Anyway, the build progress will be shown in the real time web console that appears as soon as the build is queued.

When is starts, it firstly execute the build and test tasks:


Then, if both are successful, the deploy to Azure:



When all the tasks will successfully finish, we have our web application deployed and running on Azure. Easy!

Sunday, June 7, 2015

Cloud Load Test with Visual Studio Online - part 2: Visual Studio

This article is the second one of a series of 3 where I write about the Cloud Load Testing with Visual Studio Online.

In the first part I wrote about simple load tests execution using the VSO portal.
In this article I will approach a more complex (but more complete too) solution, the integration between Visual Studio and Visual Studio Online.

Remainder
Before to start with the Cloud Load Test execution, it's important to remind a couple of aspects:
  • To use the Cloud Load Test functionality with VSO you need a MSDN Ultimate subscription
  • The application you want to test has to be public exposed on the web (because the load test agents are in the cloud and need to reach our app)
  • You can use a max of 20.000 free minutes of load test per month. They are "virtual user minutes", which means thet, i.e., if you execute a 2 minutes test with a constant load of 200 virtual users, you're going to consume 400 minutes..
Also, the Load test feature is available only on Visual Studio Ultimate/Enterprise.

That said, let's see how to setup and execute Load Tests with Visual Studio and Visual Studio Online.


Introduction
If we do a Load test with Visual Studio, we will have a plenty of settings we can configure, so this is the most tunable and customizable way to do such kind of tests.
Also, after the execution we will find a lot of information, data and charts about how our application performs under load.

Last but not least, we can do a multi step (multi page) test, even with pages under authentication, and we can record all the steps we want to do in the app in the same way a user will use it (so, no manual configuration is required for this task).


The Start
First of all, we have to create a test project in Visual Studio. The project template to use is "Web Performance and Load Test Project"


When we click on the "OK" button, VS creates for us the solution (as ever...) with a "WebTest1.webtest" project in it. This is not a "Cloud Test" project, it's a "Web Performance" one. We need this kind of project to instruct the load test in what to do.

In the upper left of the project, indeed, there is a small button with a big red dot: this is the button that allow us to record the "steps" in our application.


If we click on this button, it will open a browser session (typically IE) with a small panel on the left. This is the pane that "do the work", it's generated by the "Web Test Recorder helper" that VS installs on your machine.


As side note, remember to check if the plugin is enabled on the browser, if it isn't nothing will show.


Ok, now that the recording is active we can just visit and use the application we want to test just like a normal user will use it. We can also do some specific steps if we need to test specific pages, sections and so on.
To start the recording, write in the browser bar the url of the application and use it, the web recorder plugin will do all by itself.

When we have finished, just click on the "Stop" button in the recording pane. If we don't want to record some step, we can pause the recording and resume it later.


While we navigate our application, you will notice that a lot of "stuff" is added to the recording pane. Those are all the requests our app does.
If we select one of them and then click on the "comment" button, we can set a comment on it to be used later.

When we click on the "Stop" button, some magic happens. Firstly, Visual Studio grabs all the requests from the web recorder plugin, elaborates them and shows them in the webtest window. Then it tries to detect if we have some "dynamic parameters" in our test.


Dynamic parameters are the values that can change between one request and another one made in different moments: user tokens, user search, authentication, etc. If VS detect them, we will be prompted to decide what to do. We can decide to use the ones we recorded for every test it will do or if associate the params with "dictionary" where VS will pick different values at different times.


Another interesting aspect we can customize is related to "Request details". In this window we can decide if we want to insert a "think time" between requests (a delay) and, most important, what is for us the target time for the response. If during the test one request will have a response time greater than what we set, VS will consider the test as failed.

Now we have the webtest with all the steps and settings, we can add the Load test project.


The Load Test project
To add a load test to a web performance test, just right-click on project name, chose "Add" and than "Load test".


This action will start the "Load test wizard" which guides us through the load test setup.

On the first step, we have to select how to manage think times (delay between requests): we can use the "recorded times" (the ones that happens during registration), normal distribution (an average based on recorded times) or to remove all the think times. We can also insert a think time between iterations of the test.

In the second step we have to decide how much load we want to generate, and how to generate it.


We can select to have a constant load (the test will start with N users and will continue with the same number of users until the end) or to have a "step load".
In the image, for example, I decided to start the test with 10 users and then to add other 10 users every 10 second until a maximum of 200 users. 
Step load can be really interesting because in that way we will discover how our application scales based on the incremental load.

In the next step, we have to instruct the load test in what to do. For that reason, we will add the web performance test we created before.


Click to "Add", select the performance test and click to "Ok". The test will be added to the "test mix" window. It's called "Test Mix" because we can add as many test as we want, and we can decide the distribution of each test over the total. In this example we have only one test so the distribution will be 100%.

We can also decide, in the next steps, how to mix network types for source users (warning: when I wrote this article VSO supports only "LAN" network type) and also the kind of browser engines we want the test agents use to do the requests.


As you can see in the image, we can select from a list of different browser engines and we can also set the distribution between the user agents.

In the last step, we can customize the load test duration.


We can select between fixed time duration or number of test iterations to be done regardless of the time. If we select a fixed time (2 minutes in my example), we can also insert a "Warm-up time" (10 seconds in the example). During this time some dummy requests will be sent against the application and no result data will be collected. This is extremely useful if we has to test an application that could have a "cold start" (think for example an application hosted on IIS that could not be used for a while and than IIS "deactivated" the app pool) and to not have some false-positives in the test result.

Clicking on "Finish", Visual Studio will generate the load test project and saves it in our solution.



Test execution
Now that we have all the stuff ready, we can start our test execution. But before, only a little more customization. Indeed, we want to execute our load test using the Visual Studio Online Cloud Load test feature, but noone has said this to our local Load Test project.

To do it, open (double click) the "Local.testsettings" file in the solution and change the "Test run location" to Visual Studio Online.


Note that if you have logged in to Visual Studio with an account that own a VSO subscription, this step is not necessary because VS already selected it for you.

Ok, let's start the test. Click on the "Start button" in the upper left.


But what happens when you start the test?
Visual Studio connects to Visual Studio Online and queues the test. VSO then creates an on demand virtual lab in some Azure datacenter and configures the test agents on the VMs, with the given settings.


As soon as the lab is ready and configured, the test starts. We have configured a warm up period, so it starts with it and we can see no data is collected.


Then, the agents start to generate traffic to the given pages of our application (as used in the recording) and the results are posted back to Visual Studio in near real time. In this way we can have a preview of the test outcome.


Now we can wait the test execution ends to have the full resultset.


Results
When the test completes, we are given the results and the achieved performances. We have a lot of information available.


We have the average responses time, with also the min and the max, together with average test times, average page times and user load.

We can also see from the chart and from the info that the virtual users grew from 10 to 120 (I set 200 as maximum but it didn't have time to reach it 'cause the test lasted only 2 minutes) and how the tested application scaled.

Also in the "Throughput" page we can see other useful informations.


In this example we don't have errors, but if they had occurred we'll find them with the generic cause, the specific type and the given error message.

But this is only a small subset of all the information we can have. If we click on the "download report" link, in the upper, VS will download the whole resultset from Visual Studio Online and we can enjoy a sheet plenty of data and charts which can help us to better understand how our application performs under certain load.



Conclusions
This kind of Load Test is the most complete we can do. As we have seen, it gives us a lot of informations, metrics and charts to better understand our application behaviours.
Moreover, the setup of these tests is simple but very customizable and in a while we can have a huge number of useful info.

Stay tuned for the 3rd and last article of this series, which will be about Load Test APIs.