Load Testing Azure WebApps from Microsoft Azure Portal

I am excited to share about a great feature added to Azure Web Applications experience in Azure Portal, which is the capability to do Load Testing of the web application right from the Azure Portal. There is a detailed blog post on Visual Studio MSDN Blogs about this announcement – Announcing Public Preview for Performance/Load Testing of Azure WebApp. Similar announcement on the Azure blog – Public Preview of Performance Test on Web and Mobile App.

Here are two videos on the topic on Channel9 (Do watch them):

  1. Azure Friday Video on Performance Testing Web Apps
  2. And follow up video on doing Advanced scenarios from Visual Studio Enterprise

I know what you are feeling, the experience and the User Interface looks just brilliant, right?. Yes, Its brilliant. There has been a great effort behind it building this experience :). There were good challenges and great great learning as well.

And I do think you would be interested in understanding how is the new Azure Portal being built. There is a very good blog from Justin Beckwith which explains this stuff perfectly – Under the hood of the new Azure Portal. I recommend this as a must read blog to know about the new portal. Make sure you watch Steve Sanderson video as well, its really cool.

Please do try out the new feature and share your valuable feedback.

Question and Answers.

Question: How to use an existing Visual Studio Online account work with the new Load/Performance Test Experience in Azure Portal?

Answer: Your Visual Studio account should AAD backed. To know if you account is AAD back you can go to the account settings and figure if it AAD backed. Else you can follow the link provided there 

There is a blog post which should make things easy: Link Visual Studio Account to Azure

Question: [A very very rare scenario] I am facing issue setting an account like mentioned below. How to unblock my self?


Answer: You shouldn’t be seeing this at all. But there is a very negligible chance you might face this. In such cases, you can click on the gear button at the top right corner of the Azure Portal that takes you to the “Portal Settings”. Here you can click on the “Discard modifications” button and things should start work.



The impact of this change is that it would clear any user settings in the Azure Portal like the pinned tiles on the home page will be cleared and specific user settings that are customized would be reverted and portal would be started afresh. Please note that it would not clear any application data.

Getting started with Big Data

Recently I have developed a lot of interest in learning Big Data and started exploring different learnings. I will provide links to some of the good resources I came across here, so that this would be a good starting point. I would request readers to suggest any additional readings in the comments.

1. Getting Started with Microsoft Big Data – From Microsoft Virtual Academy. This training has good introduction to using Windows Azure HDInsight. The sessions walk you through running MapReduce Jobs, Hive etc. These sessions a little out dated but you will get an Idea

2. Getting started with Windows Azure HDInsight : This has the latest documentation with up to date information on HDInsight.

The above two links are from Microsoft Technologies.

3. Yahoo! Hadoop Tutorial : This has a very good description of Hadoop Architecture

4. Apart from these, there are good courses on Coursera (Data Science, this is a very good course to get an idea of various Big Data solutions), Cloudera Training

5. Introduction to Hadoop and MapReduce: This is a course on Udacity. Very quick to finish. Really nice one.

6. Map Reduce – A really simple Introduction – here

Please do suggest any good references that would help me and other readers.

Migrating from Azure Caching service to Dedicate Cache

1. Introduction:

This post is mainly targeted at helping users in migrating their existing cloud project that run with Azure caching service to dedicate Cache. To get an introduction on what’s new with dedicated cache please visit Distributed Cache section in Scottgu’s blog post – here

Two things to do before starting

1. First thing to do before starting the migration plan is to decide which of the two deployment modes would you like to use – either Enable cache in one of your existing roles which makes cache to co-exist with your app (let’s call this is Co-located) or host cache in a separate role (let’s call this Dedicated Role for purpose of our discussion).

2. Install/Upgrade to latest 1.7 SDK.

2. Enabling and using Cache in different deployment modes

OK. Now you have decided on which dedicated model to use. This section talks about enabling and using cache in different modes.

2.1 Setting up the cache service:

Open Visual Studio. Open your existing cache cloud project, under the “Roles” folder, right click on a role select its properties.

Here you can find a new “Caching” Tab (This would show up only if 1.7 SDK is installed). It looks like below.

In co-located role model, enable cache for your role of interest by selecting “Enable Caching” in the “Caching” tab. Once you have enabled cache, you can choose what percentage of memory on your role can be used by cache by choosing “Co-located role” option and accordingly adjusting the size as per your requirements.

In order to have a dedicated role, right click on the “Roles” section -> Add -> “New Worker Role”. Choose a “Cache Worker Role” to add to the project. In the newly added Cache Worker Role’s properties, go to Caching tab and you can observe “Dedicate Role” option is selected.

Note: Before you deploy your application to Azure, specify Storage account credentials. Clicking on the button to specify storage account brings up this dialog box where you can specify the storage account where cache runtime information is logged.

2.2 Creating caches:

When you enable caching, by default you will have a “default” cache created. New named caches can be created quickly in the Visual Studio IDE. To create named caches, go to the “Caching” Tab (as mentioned in the previous section), under the “Named Cache Settings” click on “Add Named Cache” to add a cache, clicking on “Remove Named Cache” would remove a selected cache from the list. Cache settings are defined at the end of the section.

2.3 Consuming the cache from client application

Now let’s look into what changes would be required to your existing application’s client configuration to use dedicated cache models. A pre-requisite for the next steps is to install nuget

1. Firstly remove the following dlls from your client role references

–        Microsoft.ApplicationServer.Caching.Client
–        Microsoft.ApplicationServer.Caching.Core
–        Microsoft.Web.DistributedCache
–        Microsoft.WindowsFabric.Common
–        Microsoft.WindowsFabric.Data.Common

2. Right click on cache client role, select “Manage Nuget Packages”. Search for “Windows Azure Caching Preview” package and Install the package. This would add all the necessary dlls to your references.

3. If the client configuration is in app.config, below changes are required.

This is what is currently present in your app.config.

<section name=”dataCacheClient type=”Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core” allowLocation=”true” allowDefinition=”Everywhere”/>
<host name=”cacheName.cache.windows.net” cachePort=”22233″ />
<securityProperties mode=”Message”>
<messageSecurity authorizationInfo=”ACSToken”>

This is what you need to update to

<section name=”dataCacheClients” type=”Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core” allowLocation=”true” allowDefinition=”Everywhere” />
<tracing sinkType=”DiagnosticSink” traceLevel=”Error” />
<dataCacheClient name=”default”>
<autoDiscover isEnabled=”true” identifier=”[cache cluster role name]” />

Notice the difference in the above configurations. The words that are bolded above indicate that the section name in configSection and the data cache client(s) tag name should be same.

You would no longer need <hosts> and <securityProperties>.Instead of <hosts> you need to mention an identifier, which is the role name in which the cache enabled.

You wouldn’t need any security settings here because your application and cache service are in the same deployment and hence secured.

4. If client configuration is programmatic, do the below changes

Your existing code:

string hostName = “[Cache endpoint without port]”;
int cachePort;
cachePort = sslEnabled ? 22243 : 22233; // Default port
List<DataCacheServerEndpoint> server = new List<DataCacheServerEndpoint>();
server.Add(new DataCacheServerEndpoint(hostName, cachePort));
DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration();
string authenticationToken = “[InsertAuthenticationTokenHere]”;
SecureString secureAuthenticationToken = GetSecureString(authenticationToken);
config.SecurityProperties = new DataCacheSecurity(secureAuthenticationToken, sslEnabled);
config.Servers = server;
DataCacheFactory myCacheFactory = new DataCacheFactory(config);
myDefaultCache = myCacheFactory.GetDefaultCache();

Below is what you need to update to:

To continue with Default cache:

Co-located mode:

DataCacheFactoryConfiguration cfg = new DataCacheFactoryConfiguration();
cfg.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true);
DataCacheFactory dcf = new DataCacheFactory(cfg);
DataCache dc = dcf.GetDefaultCache();

Dedicated mode:

DataCacheFactoryConfiguration cfg = new DataCacheFactoryConfiguration();
cfg.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true,”[cache role name]”);
DataCacheFactory dcf = new DataCacheFactory(cfg);
DataCache dc = dcf.GetDefaultCache();

In order to use named caches, everything remains the same except DataCache object initialization which would be:

DataCache dc = dcf.GetCache(“[namedCache]”);

As mentioned earlier, you can observe that DataCacheServerEndpoint and DataCacheSecurity are not required in dedicated Cache, instead of these we used AutoDiscoveryProperty.

2.4 Enabling Diagnostics for the cache service:

Cache Diagnostics, enabling crash dumps and performance counters for cache service would be discussed in a different article that talk about troubleshooting tips and tricks.

2.5 Cache Settings description:

Name – indicates the cache name

Backup copies – is to enable High Availability which would create a copy of the data on the number of nodes specified

Notifications – will enable notifications for this cache

Eviction Policy – specifies the policy to use when you want to evict certain objects from cache

Time To Live – default time for an object to live in cache

Expiration Type – indicated the expiration type for an object in cache.

3. Advanced cache configuration Options:

Enabling Local cache:

–        with  Notifications:

  • The local cache items get invalidated using notification based mechanism. In order to have notifications support, the cache should be enabled with notifications while creating a named as mentioned in the earlier section.

<dataCacheClient name=”default”>
<localCache isEnabled=”true” sync=”NotificationBased” objectCount=”100000″ ttlValue=”300″ />

–        with TTL:

  • The local cache items get invalidated using TTL based mechanism here

<dataCacheClient name=”default”>
<localCache isEnabled=”true” sync=”TimeoutBased” objectCount=”100000″ ttlValue=”300″ />

4. Simulation in Development Fabric

Development fabric (Dev fabric) can be used for simulation before deploying to Azure. Start debugging your project in Visual Studio for a Dev fabric run. The cache server process for Dev fabric is emulated on the machine in this case.

To exit Dev fabric gracefully, use “Exit” from its menu options or from system tray instead of killing any process.

5. Deploy Application to Azure

Now you are ready to deploy your application to Azure. Right click on the cloud project, you can find option to either “Publish” the project to one of your slots or create a “Package” and upload the .cspkg and .cscfg from the Azure portal.

Windows Azure Caching: New Capabilities

This talk by Shyam Seshadri, present you the new capabilities in Windows Azure Caching.

Overview : Windows Azure Caching is a simple to use distributed cache that can help make your applications perform faster and be more scalable. In this session we will quickly get you up to speed on Caching and show you what it can do and how it works. The majority of the session will focus on new capabilities we are delivering in the next release – Windows Azure Caching (Preview) – that redefines caching on Windows Azure. This new release brings additional features, performance improvements and new deployment options that result in a significantly improved and flexible caching model for Windows Azure.