So everyone wants to have the ultimate system that never breaks can handle ‘all’ the users and shows no strain when doing so. How do you accomplish something like this? Well you could hire developers that know all the best ways to do everything, experts in everything related to configuring applications to run the best that they can on the hardware and software it sits on but what’s the odds of that happening. The other option is to have a bank account that is never ending and throw ‘all’ the hardware at your application to make sure it doesn’t ever have a slow day but then how are you making your money, how do you know when ‘all’ the hardware isn’t enough.

You need to know how much load you can handle and it’s not ideal to figure out this limit when customers are browsing your site. I have read about a lot of stories lately where rather popular and big online sales companies have amazing specials for a limited time only where some of them even doubled there on-premise hardware to hopefully manage with the load that they were expecting they could get.

Load testing is an important part of running any online system because you need to know where your limits are before customers help you find them. Lots of companies for various reasons including legal can’t run their systems in the cloud and so what they usually do is run a lot more hardware than what is required because auto scaling hardware on-premise is not as easy as in the cloud. Load testing could help you figure out how much load you can handle with your current system and then help make hardware purchases for hardware that is required and not for hardware that you think you may need.

One way to load test could be to use the Load Testing tools in Visual Studio but then without using the cloud you can only generate as much traffic as the machine running that test can output. This is where you can benefit from running load tests in Azure because you can choose how much load you want to generate and Azure would spin up as much hardware that is required to meet your requirements, hardware that you would have to additionally purchase if you did this on-premise.

Let’s run through how this works today in Azure.

Linking your VSO account

So first off to use this functionality you need to have a Visual Studio Online account. Luckily linking this is very easy and is part of the flow of setting up the load testing. Let’s navigate to a website that we want load test and click on Tools, in my case I’m going to choose my blog.


In the develop section you will notice a Performance Test link, click on that link


You will now be taken to the Performance tests blade, as you will notice if you haven’t been hear before you need to link a VSO account before you can get started.


Click on the Set Account button in the toolbar


This will open the Account Settings blade, go through this blade as you would any other settings blade selecting an option from each of the options on the blade. Note if you don’t have a VSO account you can also easily create one from here using the Or Create New link


After you have selected your account you will see that the Subscription and location should auto fill for you, the Subscription should come from the current subscription you have selected in the azure portal at the current time. The location will be locked down to North Central US, this is probably because the feature is still in preview. Click ok at the bottom of the blade to make this VSO account be the selected account


This will now show that you have no performance tests yet and you are now able to create your first performance test.

Creating a performance test

At this stage we have our VSO account linked and can now click the New button to get started


You will now be asked a could things in order to create your load test


Firstly you need to give the url to the page to put under load and a name for this load test. You then will need to select the location to generate tests from, note you are shown where your app is currently running in the list of locations


You will then need to specify the virtual user load to generate


and then lastly you select the amount of minutes to run your test for


Now all that is left to do is click Run test at the bottom of the blade


Test Results

You should see the following happening, your test should show in the Recent runs as Queued


After a small bit you should see a start time being populated


And then very shortly later you will see the progress change to InProgress and at this point your  load test is under way


And then lastly it would switch to Completed and you would see the Average Response Time in seconds


While the test is running you are able to click on the test row and see the results which looks like the image below


You can hover your mouse over the graph to get information on what the values were at certain times in the test run


As you can see I have some work that I need to do Smile, or increase my scaling in Azure Open-mouthed smile.

More info about load testing in Azure

A nice touch that I haven’t noticed before with other services (and it could have just been a coincidence) is that when I started my load test I received a mail from Microsoft giving me more links and information about this new functionality in Azure. Some links are below

Have a good idea for a new feature? Head over to the Visual Studio User Voice site and add it Smile.


So if you haven't heard yet VSO Extensions are now in a private preview where you can sign up to get into the preview on extensions integration site. These extensions in the shortest sentence a supported way of doing customizations to VSO that will replace any of the "hacky" extensions that you may be playing around with at the moment like Tiago Pascal's Task Board Enhancer or maybe you have even created your own following similar steps to what I show in my TFS 2013 Customization book.

This post aims to give you a super quick guide on how to get started, you will need to go through the integrations site to really get into detail. It has most of what you will find in most posts but gives you a little something extra that most posts wouldn't have like tips on free stuff Smile

File, New Project

The easiest way to get a basic something in VSO is to just create a new project.

Create/Configure Project

We are going to create a new Type Script project


You should have something like below now


Configure SSL in IIS Express

When you have the VSO Time Ticker project selected head over to the properties window


Change SSL Enabled to True


Take note of the SSL Url that is now available to you.

Add a extensions.json

Let's add a extensions.json manifest file that will be used to inform VSO what our projects actually about


and drop in the content below, replace the baseUri property to include the port you have been assigned for SSL for the project.

"namespace": "VSO-Time-Ticker",
"version": "0.0.1",
"name": "Time Ticker",
"description": "A simple extension for Visual Studio Online of a Time Ticker",
"provider": {
"name": "Gordon Beeming"
"baseUri": "https://localhost:44300/",
"icon": "https://localhost:44300/images/some-icon.png",
"contributions": {
"vss.web#hubs": [
"id": "time",
"name": "Time",
"groupId": "home",
"order": 22,
"uri": "index.html",
"usesSdk": true,
"fullPage": false

Get the SDK

Navigate to GitHub to the samples project and grab the VSS.SDK.js file. Save a copy of that to a scripts folder inside a sdk folder and add it to your project.


Include our App js files

While we here let's build the project, show hidden folders and add the app.js and app.js.map files to the project

If you are using source control you should also at this point undo those files being added source control and then also add them to be excluded otherwise you may get a weird error when it comes time to build your project on a build server (TypeScript : Emit Error: Write to file failed...).
The reason we want these as part of the solution is so that when we do web deploy later they are deployed as well Smile.

Add our app icon

Make a images folder and add a image called some-icon.png to it

Move App js file

Move your App.ts, App.js and App.js.map into a scripts folder. If you have source you might need to re undo and ignore those extra files.


Setup index.html

This is a rather simple step, replace the reference to app.js with one to sdk/Scripts/VSS.SDK.js so it will look something like


Add the following script just inside your body tag

<script type="text/javascript">
// Initialize the VSS sdk
setupModuleLoader: true,
moduleLoaderConfig: {
paths: {
"Scripts": "scripts"

// Wait for the SDK to be initialized
VSS.ready(function () {
require(["Scripts/app"], function (app) { });
So at this stage your full index.html page will look like
<!DOCTYPE html>

<html lang="en">
<meta charset="utf-8" />
<title>TypeScript HTML App</title>
<link rel="stylesheet" href="app.css" type="text/css" />
<script src="sdk/Scripts/VSS.SDK.js"></script>
<script type="text/javascript">
// Initialize the VSS sdk
setupModuleLoader: true,
moduleLoaderConfig: {
paths: {
"Scripts": "scripts"

// Wait for the SDK to be initialized
VSS.ready(function () {
require(["Scripts/app"], function (app) { });
<h1>TypeScript HTML App</h1>

<div id="content"></div>

Update App.ts

In your App.ts file remove the window.onload function and replace it with it's body so your App.ts file will look like below

class Greeter {
element: HTMLElement;
span: HTMLElement;
timerToken: number;

constructor(element: HTMLElement) {
this.element = element;
this.element.innerHTML += "The time is: ";
this.span = document.createElement('span');
this.span.innerText = new Date().toUTCString();

start() {
this.timerToken = setInterval(() => this.span.innerHTML = new Date().toUTCString(), 500);

stop() {


var el = document.getElementById('content');
var greeter = new Greeter(el);

Run App

Running your app with ctrl + F5 you will get a blank app that does nothing Smile


Changed the url to point to the SSL version of your site just to make sure everything is working


Our App is now complete Open-mouthed smile

Install your extension

If you have signed up for the private preview you should see a tab in the admin section of your account called Extensions like so


Click Install, and then Browse 

browse for your extension.json file

Click Open and then OK


Your extension is now installed


View it on VSO

Go to a team project home page and you should now see a Time hub, click on it


Once you land here you will the time Smile


That's 1 extension in the bag but having this run on your local machine is probable not want you would want because nobody else can see it.

Publishing you app

You could buy an SSL certification but that costs a lot and most people don't have that kind of money laying around for fun apps and extensions so we'll turn to Azure. We will now right click on our project and click publish


If you setup an Azure site already you can import the publish settings but I haven't so I'm going to click on Microsoft Azure Web Apps


and then click on New (again if you have a site already you can select it in this list)


Select a name and click Create


it will now take a small bit to setup your azure resource


and then auto magically configure everything you need Smile, click Publish


After the publish is finish your site will launch


Something that you will notice is that this is http but and not https as we said earlier we require. So let's see what happens if we add a s in there Smile


Everything still works Open-mouthed smile.

Last bit of manifest changes

Now that we have a publicly accessible website running on https (for FREE) we can take that url and replace what we currently have in our manifest so it will now look like this

"namespace": "VSO-Time-Ticker",
"version": "0.0.2",
"name": "Time Ticker",
"description": "A simple extension for Visual Studio Online of a Time Ticker",
"provider": {
"name": "Gordon Beeming"
"baseUri": "https://vso-hello-world.azurewebsites.net/",
"icon": "https://vso-hello-world.azurewebsites.net/images/some-icon.png",
"contributions": {
"vss.web#hubs": [
"id": "time",
"name": "Time",
"groupId": "home",
"order": 22,
"uri": "index.html",
"usesSdk": true,
"fullPage": false
Re-install your extension


and refresh your extension in VSO


You will notice now that it obviously still works Smile, if you close Visual Studio and it still works you know it working Smile and I suppose you can check fiddler for where it's reading the files from.


For more info on VSO Extensions visit http://aka.ms/vsoextensions.

A pretty neat getting started post is also on that site at https://www.visualstudio.com/en-us/integrate/extensions/get-started/visual-studio.

Microsoft has a project out on GitHub as well that is quite advanced in the API's that it uses and can be found at https://github.com/Microsoft/vso-team-calendar.

If you want a light overview over everything then you can get their VSO Extension Samples out on GitHub as well using the link https://github.com/Microsoft/vso-extension-samples.

Complete Sample code for this post is also out on Github at https://github.com/Gordon-Beeming/VSO-Time-Ticker


In the new Azure Portal you create all your resources in Resource Groups, there is also as part of the Azure SDK's a module called AzureResourceManager  by default the module loaded for the Azure SDK is AzureServiceManagement. A blurb from one of the Azure documentation page reads

"The Azure and Azure Resource Manager modules are not designed to be used in the same Windows PowerShell session. To make it easy to switch between them, we have added a new cmdlet, Switch-AzureMode, to the Azure Profile module."

Azure Resource Manager Commands

To get a list of all commands that are available for the AzureResourceManager module you can run the command

Get-Command -Module AzureResourceManager | Get-Help | Format-Table Name, Synopsis

this will return






Adds the Azure account to Windows PowerShell


Creates an Azure environment


Clears an Azure profile


Disables the option to directly access to an Azure Sql database (without auditing)


Disables direct access to all Azure Sql databases that use the audit policy of a Sql databa...


Enables the option to directly access to an Azure Sql database (with auditing)


Enables direct access to all Azure Sql databases that use the audit policy of a Sql databas...


Gets Azure accounts that are available to Azure PowerShell.


Filters active directory groups.


Get a group members.


Filters active directory service principals.


Filters active directory users.






Gets information about Data Factory.


Gets information about logical gateways in Data Factory.


Gets information about hubs in Data Factory.


Gets information about linked services in Data Factory.


Gets information about pipelines in Data Factory.


Gets runs for a data slice of a table in Data Factory.


Gets data slices for a table in Data Factory.


Gets information about tables in Data Factory.


Gets Azure environments


Gets the resource types and the Azure data center locations that support them.


Downloads the publish settings file for an Azure subscription.


Gets details about a single cache or all caches in the specified resource group or all cach...


Gets the accesskeys for the specified redis cache.


Gets Azure resources


Gets Azure resource groups


Gets the deployments in a resource group.


Gets resource group templates in the gallery


Gets the deployment log for a resource group


Filters role assignments.


Filters role definitions.


Gets an Azure Sql database's auditing policy.


Gets an Azure Sql server's auditing policy.


Gets Azure subscriptions in Azure account.


Gets predefined Azure tags


Imports a publish settings file that lets you manage your Azure accounts in Windows PowerSh...






Creates a data factory.


Encrypts sensitive data.


Creates a gateway for Data Factory.


Creates a gateway key for Data Factory.


Creates a hub for Data Factory.


Links a data store or a cloud service to Data Factory.


Creates a pipeline in Data Factory.


Creates a table in Data Factory.


Creates a new redis cache.


Regenerates the access key of a redis cache.


Creates a new resource in a resource group


Creates an Azure resource group and its resources


Add an Azure deployment to a resource group.


Create a role assignment to some principals at a given scope.


Creates a predefined Azure tag or adds values to an existing tag


Deletes an Azure account from Windows PowerShell.




Removes a data factory.


Removes a gateway from Data Factory.


Removes a hub from Data Factory.


Removes a linked service from Data Factory.


Removes a pipeline from Data Factory.


Removes a table from Data Factory.


Deletes an Azure environment from Windows PowerShell


Remove redis cache if exists.


Deletes a resource


Deletes a resource group.


Removes a role assignment.


Disables an Azure Sql database's auditing.


Disables auditing of all the databases that rely on the auditing policy of the given databa...


Deletes an Azure subscription from Windows PowerShell.


Deletes predefined Azure tags or values


Resumes a suspended pipeline in Data Factory.


Downloads log files from HDInsight processing.


Saves a gallery template to a JSON file


Changes the current and default Azure subscriptions




Sets the description for a gateway in Data Factory.


Configures the active period for data slices.


Sets the status of slices for a table in Data Factory.


Changes the properties of an Azure environment


Set redis cache updatable parameters.


Changes the properties of an Azure resource.


Changes the properties of a resource group


Sets an Azure Sql database's auditing policy.


Sets an Azure Sql database server's auditing policy.


Creates or changes an Azure subscription


Cancels a resource group deployment


Suspends a pipeline in Data Factory.


Switches between the Azure and Azure Resource Manager modules


Detects errors in a resource group template or template parameters


Marks an Azure Sql database as using its server's auditing policy.

Step 0

As a step 0 lets open up everything we need.

Azure SDK

So to get started you need to install the Azure SDK which you can get from the SDK downloads page. I am using Azure SDK 2.5 version for this post.

PowerShell ISE

Open the PowerShell ISE using Win + R and then %WINDIR%\system32\WindowsPowerShell\v1.0\powershell_ise.exe. You can also use the standard PowerShell window if you want.

Azure Management Portal

Open and sign in to the Azure Management Portal (https://manage.windowsazure.com/)

Azure Portal

Open and sign in to the Azure Portal (http://portal.azure.com/)

Step 1

Let's start by getting the Azure Management Portal pieces out the way. In the Azure Management Portal we will just be creating a new AAD user that we can use to automatically login through PowerShell. If you want to use a MSA just leave the credentials bit off in Step 3 and you will receive a prompt for credentials at which time you can use MSA or AAD credentials and you can now move to step 2. If you want to create the new user follow my other post Creating a new Azure Active Directory User to create a user for this demo.

Step 2

In the PowerShell ISE we will kick off by switching the Azure SDK to use the resource manager module.

Switch-AzureMode -Name AzureResourceManager

Step 3

After we have switched to the AzureResourceManager module we are able to use the commands that are part of it. Let's start off by adding our Azure Account we just created using the snippet below (I keep my username and password in txt files and reference from multiple sample scripts for ease of use but you can place them straight in the script if you wanted

[string]$currentUsername = Get-Content "Z:\_PowerShell\Azure\currentUser.txt"
[string]$currentPassword = Get-Content "Z:\_PowerShell\Azure\currentPass.txt"
$secpasswd = ConvertTo-SecureString $currentPassword -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ($currentUsername, $secpasswd)
Add-AzureAccount -credential $mycreds


This would then return the account added


At this point if you ran Get-AzureAccount it will show you this account and any others you have previously added.


Step 4

Next we'll explore some meta data for Step 5.

Getting a Resource Group Template

We can run the command


and it will return a list of all the current resources group templates that we can create. For the list at the time of writing this post you can refer to one of my GitHub Gists at https://binary-stuff.com/gist/ea0884f5ba00c62a83e4. We are going to be using one of the templates found around line 2220 which is the website and sql database.


Get a list of Azure Resource Locations

When creating Azure Resources you need to specify were those resources are located geographically. Now you could guess or Bing what the locations are or you could use the handy command


which will return you a list of every location that every resource is available in. This list as with the one above can be found as one of my GitHub Gists at https://binary-stuff.com/gist/87aad8bfbbbcd7421b83. From the long list of locations we are just going to use West Europe for all our resources

Step 5

At this point we have all the info we need to create our resources using the resource manager in powershell so we'll use the snippet

$ResourceManagerTest = "ResourceManagerTest"
$AzureDataCenterLocation = "West Europe"
$administratorLoginPassword = ConvertTo-SecureString "$($ResourceManagerTest)DbP@ssw0rd" -AsPlainText -Force
New-AzureResourceGroup -Name "$($ResourceManagerTest)" `
-Location "$AzureDataCenterLocation" `
-GalleryTemplateIdentity Microsoft.WebSiteSQLDatabase.0.2.2-preview `
-siteName "$($ResourceManagerTest)Site" `
-hostingPlanName "$($ResourceManagerTest)Plan" `
-siteLocation "$AzureDataCenterLocation" `
-serverName "$($ResourceManagerTest.ToLowerInvariant())dbserver" `
-serverLocation "$AzureDataCenterLocation" `
-administratorLogin "$($ResourceManagerTest)DbLogin" `
-administratorLoginPassword $administratorLoginPassword `
-databaseName "$($ResourceManagerTest)DbName" `

This will then go off and create our website and database along with an Application Insights resource that we can use for our website when we deploy it. When the command finishes you should see an output similar to the one below which because we specified the -verbose flag tells us the status of each resource created


At this point we really are finished with what the subject of the blog post is but we'll continue on to explore what we have just created, how we would have had to create it using the Azure Portal and how we can remove the resource group using PowerShell.

Step 6

Open the Azure Portal. The first thing you should notice is that you already have a notification and when you open that it says that a deployment has succeeded.


Clicking on the success notification will open that resource group


From here you can use the resources 100% as if you created them in the portal.

Step 7

Before we see how we would have had to create those resources manually let's remove the resource group from our subscription. To do this we run the simple command below keeping in mind that the $ResourceManagerTest variable should still be set from the previous command in step 5

Remove-AzureResourceGroup -Name $ResourceManagerTest -Force -Verbose

this will then proceed to remove the resource group, again because of the -verbose flag we don't get as much info but rather just that it's deleting the resource group and then comes back when it's done.


Step 8

The last thing that I'll show on this post is how we would of have to do this manually (or at least where to find template). Back in the Azure Portal click new in the bottom left corner and then click on Everything


Next click on the Web category/section and then you'll see the Website + SQL option which is what we created


clicking on that option will give you a little info about the template and from here you'd just click on create


From here you will configure the Resource Group Name, all the settings for your Website resource and SQL resource and then click create.


When that process completes you will be in the sample place as that small PowerShell script gets you too Smile

Thoughts and comments

If you have any thoughts or comments about any of the pieces of this post please do share below.


Open the Azure Management Portal, login and then navigate to the Active Directory tab and click on the Active Directory resource you want to add a user to, alternatively create a new Azure Active Directory resource and then come back to this post.


Now click on the Users tab and then Add User


Go through the wizard choosing the username what domain you want to create the user in, also enter some basic personal info in step 2 of the wizard and then click create in step 3.


This will then create the user, you can now either login with that user and temp password to set the password or type an email address and then email yourself instructions


If you request an email it will look something like below with some basic info like temp credentials how long the password would stay active for and login instructions to get into the portal


After login in you will be prompt to set a new password where you will enter your existing temp password and a new one.


You will notice that if you have followed the instructions as is after login in you get a message saying you have no subscriptions.


If you want this user to be able to login to the Azure Portal and manage resources you would need to assign them a subscription. Follow my other post Assign a Azure Subscription to a existing user to accomplish this Smile.


If you have logged into the Azure Management Portal and see a message like below then you need to have a azure subscription assigned to you in order to use the portal and this post is going to help you (probably your Administrator) assign a subscription to your account.


To Get started from this point you'd need to login to the Azure Management Portal as an Administrator. One of the ways to assign a user a subscription is to buy one or you can add the user as a co-administrator of an existing subscription (if they would need to admin those resources). In this post we'll show you how to add a co-administrator. Click on the Settings tab and then the Administrators tab and then click on Add.


This dialog is a simple one enter the email address of the user you want to add as a co-administrator and then check the subscription you want to add them to. You will notice that it will automatically detect the AAD that the account is linked to or if it is a MSA.


Click on the tick, you will get a progress message


shortly followed by a success message


At this point if you navigate back to the Azure Management Portal as the user you will be given access and will be shown a quick Azure Management Portal Tour.