All posts by GavinS

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Have you ever gotten the error:

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

And your string looks valid?   Case in point:

‘Guid.Parse(“a2d979b0-26b5-11e7-be4d-cd02cf813brd”)’ threw an exception of type ‘System.FormatException’
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233033
HelpLink: null
InnerException: null
Message: “Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).”
Source: “mscorlib”
StackTrace: ” at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)\r\n at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result)\r\n at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)\r\n at System.Guid.Parse(String input)”
TargetSite: {Void SetFailure(ParseFailureKind, System.String, System.Object, System.String, System.Exception)}

So what gives?  The Guid appears valid in format:

—–8—– – —4— – —4— —4— ——–12——–

a2d979b0 – 26b5 – 11e7 – be4d – cd02cf813brd

If you look at the definition of the Guid type in .NET:

Type: System.String

A string that contains a GUID in one of the following formats (“d” represents a hexadecimal digit whose case is ignored):

32 contiguous digits:



Groups of 8, 4, 4, 4, and 12 digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses:







Groups of 8, 4, and 4 digits, and a subset of eight groups of 2 digits, with each group prefixed by “0x” or “0X”, and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces:

{0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}

All braces, commas, and “0x” prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored.

The digits shown in a group are the maximum number of meaningful digits that can appear in that group. You can specify from 1 to the number of digits shown for a group. The specified digits are assumed to be the low-order digits of the group.

So, whats wrong with my string?


A GUID is a 16-byte (128-bit) number, typically represented by a 32-character hexadecimal string. A GUID (in hex form) need not contain any alpha characters, though by chance it probably would. If you are targeting a GUID in hex form, you can check that the string is 32-characters long (after stripping dashes and curly brackets) and has only letters A-F and numbers.

So, there is the problem, a Guid isn’t just a random string of Digits and Characters, it’s a string representation of a 128 bit number!

Make sure you only have A-F and 0-9!

What else can go wrong?  Check out this Guid:


When parsing it I get:

‘Guid.Parse(“E6F85AE0‐F479‐4E98‐9287‐98F7E62BA083”)’ threw an exception of type ‘System.FormatException’
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233033
HelpLink: null
InnerException: null
Message: “Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).”
Source: “mscorlib”
StackTrace: ” at System.Guid.TryParseGuidWithNoStyle(String guidString, GuidResult& result)\r\n at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)\r\n at System.Guid.Parse(String input)”
TargetSite: {Boolean TryParseGuidWithNoStyle(System.String, GuidResult ByRef)}

The Guid Seems ok,


All the characters are A-F and 0-9, what else could be wrong?

Try converting your string to its ASCII equivalent:

The result:

ASCII: 34 69 54 70 56 53 65 69 48 NULL 70 52 55 57 NULL 52 69 57 56 NULL 57 50 56 55 NULL 57 56 70 55 69 54 50 66 65 48 56 51 34

What are those NULLS?

Look at the HEX:

22 45 36 46 38 35 41 45 30 1 46 34 37 39 1 34 45 39 38 1 39 32 38 37 1 39 38 46 37 45 36 32 42 41 30 38 33 22

Retype the string manually (DONT COPY/PASTE!)


Now get its ASCII

34 69 54 70 56 53 65 69 48 45 70 52 55 57 45 52 69 57 56 45 57 50 56 55 45 57 56 70 55 69 54 50 66 65 48 56 51 34

(No more NULLS)

and HEX:

22 45 36 46 38 35 41 45 30 2D 46 34 37 39 2D 34 45 39 38 2D 39 32 38 37 2D 39 38 46 37 45 36 32 42 41 30 38 33 22

See the difference?

22 45 36 46 38 35 41 45 30 1 46 34 37 39 1 34 45 39 38 1 39 32 38 37 1 39 38 46 37 45 36 32 42 41 30 38 33 22 

22 45 36 46 38 35 41 45 30 2D 46 34 37 39 2D 34 45 39 38 2D 39 32 38 37 2D 39 38 46 37 45 36 32 42 41 30 38 33 22

Its the hyphens!  They are actually a different character!

This is a common issue on the web!  Sometimes when encoding values from Unicode, ASCII, UTF-8, etc, characters can get transposed.

So, next time you run into some “weirdness” with strings and Guids, Don’t give up! think outside the box!

“No App Service Environments in this subscription”

Adding an application to an Azure Application Service Environment (ASE) is a pretty straight-forward operation, but sometimes you will get:

“No App Service Environments in this subscription”

What does this mean?  Why isn’t the App Service Environment in the list?

App Service Environments are a premium feature of the Microsoft Cloud.   It provides a fully isolated and dedicated environment for securely running Azure App Service apps at high scale, including Web Apps, Mobile Apps, and API Apps.

App Service Environments scale differently than most apps in Azure.  First, the ASE itself defines a set of worker pool instances:

The pool instance counts represent the number of physical resources available in each worker pool in your ASE.

If you click on your ASE’s main blade, then select Worker Pools.  Then choose a worker pool.  You can see the resources allocated in the pool:

Notice the “Workers Available” is 0.  Because of this I’m unable to add any new applications or App Service Plans to the ASE.  You first need to increase the scale of the pool to accommodate additional resources.

Here I’ve increased the Worker pool 1 Instance Count from 2 to 3.

At the time of this writing, ASE scale operations take several hours to complete. You will see this notification while the scale operation is in progress.

Once completed.  You now have an extra instance available in your worker pool to add an additional App Service Plan and Application.

You can see the App Service Environment is now available in the Location drop down, now that there is additional capacity in the Worker Pool for the App Service Plan.

How to add a new App Service Plan (ASP) to an App Service Environment (ASE)

An Azure App Service Environment is a premium tier offering for high scale applications that can isolate your application on a custom virtual network and give you more control over the compute resources allocated to your applications.

To increase the scale and control over the Applications running in your ASE, you can add additional App Service Plans to your ASE.

When you first work with ASE’s however, it doesn’t seem obvious how to add additional service plans to your ASE.

When creating an additional App Service Plan, you have to have enough instances in the ASE worker pool before you are allowed to create the ASP.

As you can see below, I can’t select my ASE from the location list:

When you want to add an additional ASP to your ASE, you select the ASE itself as the location for the creation of the ASP.

Without enough instances in your ASE worker pool, the ASE is not available in the Location drop down when creating a new ASP.

First you need to increase the instance count in your ASE to provide additional instances for your ASP to manage.

Increase the Instance count of your Front End or Worker Pools.  This scale operation will take several hours to complete.

Once the scale operation is completed, you can now create additional App Service plans in your ASE.

Hope this helps you, It drove me crazy trying to figure this out the first few times I used ASE’s

How to Add a Co-Admin to your Azure Subscription

I’ve worked with many Azure customers.  One of the first steps to helping a new customer with Azure is getting them to add me as a Co-Admin to their Azure subscription.  While this isn’t difficult, searching for it on Google leads to a list of outdated or just wrong steps.

The Azure portal continues to change and get better as I write, so this too may be out of date at some point, but since it’s a common use case, I’ll try and keep this post updated with the latest.

Account Administrator, Service Administrator, and Co-administrator are the three kinds of administrator roles in Microsoft Azure.  The following table describes the difference between these three administrative roles.

Administrative role Limit Description
Account Administrator (AA) 1 per Azure account This is the person who signed up for or bought Azure subscriptions, and is authorized to access the Account Center and perform various management tasks. These include being able to create subscriptions, cancel subscriptions, change the billing for a subscription, and change the Service Administrator.
Service Administrator (SA) 1 per Azure subscription This role is authorized to manage services in the Azure portal. By default, for a new subscription, the Account Administrator is also the Service Administrator.
Co-administrator (CA) in the Azure classic portal 200 per subscription This role has the same access privileges as the Service Administrator, but can’t change the association of subscriptions to Azure directories.

First, you need your own Azure subscription.  You can signup and create one here: Once created, or if you already have a subscription go to the next step.

Azure currently has 2 management portals:

New portal –

Classic portal –

Using the New Portal:

Find the “Subscriptions” Key icon in the list:

Choose the subscription and the Access control (IAM)

Next select “Subscription admins”

Now select the “Manage” link at the top, this will launch the classic portal:


Using the Classic Portal:

To Add a Subscription Co-Admin using the class portal:

Navigate to the Classic Portal, then click on Subscriptions at the top of the screen:

Click “Mange Administrators”

Next Click Add on the toolbar at the bottom.

Finally, add the user’s Microsoft account or corporate identity:

This user is now a Co-Admin of your Azure Subscription.  Removing a user is just as easily done.

Co-Admin’s have full permission for modifying, deleting and  creating resources in your subscription.  They cannot see your billing information or charges.

Some things to keep in mind:

User can login to Microsoft Azure classic portal using two methods: individuals can log in using a Microsoft Account, and organizational employees can log in using an organizational account. This article describes changes to the Service Administrator and Co-Administrator functionality if you login with either method.

As a review, here’s a brief description of Service Administrator and Co-Administrator functionality:

  • The Service Administrator is a property of each Azure subscription, and it represents a person who can login to the Developer Portal and develop against a subscription (e.g. deploy to it or create new resources). Typically, an Account Administrator purchases an Azure subscription, makes his or her developer the Service Administrator and now the developer can login to the Developer Portal. A Service Administrator cannot see the subscription’s billing details in the Billing Portal. The Service Administrator can only be changed in the Billing Portal.
  • A Co-Administrator is very similar to the Service Administrator, with a small difference – they are added from within the Developer Portal and there can be multiple Co-Administrators for a subscription but only one Service Administrator. Similar to the Service Administrator, a Co-Administrator cannot see billing details.

Here are the changes to Service Administrator and Co-Administrator functionality, with the introduction of the ability to login to Azure with an organizational account:

Microsoft Account Yes No No
Organizational Account Yes Yes No
  • If you are logged in with a Microsoft Account, you can only add other Microsoft Accounts as Service Administrator or Co-Administrator. This is a security consideration to prevent non-organizational accounts from discovering if certain accounts (e.g. are valid accounts.
  • If you are logged in with an organizational account, you can add other organizational accounts in your organization as Service Administrator or Co-Administrator. For example, can add as Service Administrator or Co-Administrator, but cannot add Users logged in with organizational accounts can continue to add Microsoft Account users as Service Administrator or Co-Administrator.


Additional Resources:

Keep a tab on access settings of your Azure subscriptions

Audit Logs for Azure Events

Why the Cloud matters and how it’s changing the world.

I don’t recall the title, but I read a book once that outlined how the Industrial Revolution changed the world and made the United States boom economically.

I imagine someday in the future, someone like me will read a similar book about the Cloud and how it revolutionized the world.

Industrial Revolution and Electrification

Wikipedia outlines this time as:

“The Industrial Revolution was the transition to new manufacturing processes in the period from about 1760 to sometime between 1820 and 1840. This transition included going from hand production methods to machines, new chemical manufacturing and iron production processes, improved efficiency of water power, the increasing use of steam power, the development of machine tools and the rise of the factory system.”


In another book I read, the author outlined the advantages that came from Electrification.  All factories used to be built a long a waterway, not only for water wheels to power belt-driven tools and automation, but it also provided a much needed distribution channel by way of boat to deliver good to and from the factories.

Electrification freed new factories from these constraints, allowing new factories to be built anywhere and take advantage of unlimited power needs by way of the Electrical grid.  This allowed factories to enjoy economies of scale and produce good more efficiently.

Electrification was called “the greatest engineering achievement of the 20th Century” by the National Academy of Engineering.[3]

The Information Age and the Cloud

Again, the formal definition from Wikipedia:

The Information Age (also known as the Computer Age, Digital Age, or New Media Age) is a period in human history characterized by the shift from traditional industry that the Industrial Revolution brought through industrialization, to an economy based on information computerization. The onset of the Information Age is associated with the Digital Revolution, just as the Industrial Revolution marked the onset of the Industrial Age.

We are all living in the Information Age, it’s really an amazing time to be alive!  We’ve all watched as technology has transformed our lives. Miniaturization has enabled the creation of Mobile Phones, computers and IoT devices, making technology ubiquitous.  We communicate differently, we share information differently and social media has become a driving force of social evolution.

Continuing Education

I’ve a strong advocate of keeping my skills up to date in this industry!  Over the last several months I’ve been studying to get my Azure Solution Architect certification from Microsoft.  It’s a very hard certificate to earn, there is a lot of knowledge you have to have about Microsoft’s Cloud Azure.  So far I’ve passed 2 of the 3 exams:

microsoft_exam533 microsoft_exam532

I still have one more exam to take to get the Azure Solution Architect certification.   My point here is I’ve taken a lot of time to learn more about the cloud.

I’ve been using Windows Azure for several years now, at Solid Cloud  (my company) we design, develop, service and support custom applications for our customers in the cloud.

Since we’ve been at this a while, I’ve started to see the Cloud itself change in functionality and the way we design applications is changing.  Let me outline how cloud computing is changing.


Software companies large and small have been utilizing virtualization either from VMWare or Microsoft’s Hyper-V infrastructure for the last decade. Virtualization allows developers to get more process space out of the physical hardware they have purchased.  You can treat one physical machine as multiple machines and even snapshot and manage the state of these machines in a very flexible way.

Most developers today use the cloud and have for a few years now. Most start by setting up Virtual Machines in AWS or Azure so that they no longer have to worry about the physical hardware.  We are already used to virtualization, so why not move the machine to the cloud. There isn’t really a difference, we just don’t have to worry about the hardware anymore.

Virtualization allows you to create machines within a machine.


So, you’ve gained the ability to scale your hardware to multiple isolated environments.  As you can see, our focus shifts from hardware, to virtualized hardware.  Most modern applications don’t use many resources on a user’s computer any more.  Many applications are no longer installed, but just consumed via a web browser or mobile device.

IaaS vs PaaS vs SaaS

The scenario I outlined above, virtualization, when applied to the cloud becomes IaaS (Infrastructure as a service)  This means Microsoft’s cloud provides us the ability to create all types of virtual machines from web servers, to media servers, database servers and more.  Now we don’t have to buy any hardware and can pay for these services on-demand.

PaaS (Platform as a service)  differs from IaaS in that we focus on platform based offerings.  Storage, Load Balancing, Security, Web infrastructure, etc..  all capable of running parts of our application, but we don’t have to worry about the virtual machines or the hardware infrastructure at all for that matter!  We can create true “Cloud applications” that are solely comprised of Paas services, and don’t require any IaaS infrastructure at all!

SaaS ( Software as a service ) can provide complete cloud hostable software applications that many 3rd party ISV vendors can provide to businesses.  The SaaS model allows customers to utilize modern software platforms without needing to worry about the infrastructure needed to provide these services.

Since I’m trying to make a point about how the nature of software development is changing, lets stay focused on the differences between IaaS and PaaS.  To me, this is where the cloud really starts to offer advantages for application development.

Application Architecture

I’ve been a software engineer since the mid 90’s When I started programming, there was no internet.  We used dial-up BBS’s and shared games, etc with floppy disks.

The applications I’ve developed over the past 20 years all followed a similar architecture, outlined as a 3-tier architecture.


We designed applications in this way because of how the applications would scale.  If we needed to scale this design, we could do so by scaling out (more machines) or scaling up (more powerful hardware) whichever tier of the application was suffering.  We can even add caching mechanisms to help increase application throughput.


This design is still modeled around the hardware on which we are running.  Each of these “Tiers” typically runs on a virtual machine.  Scaling out the Web tier, we add more machines.  Scaling the Business or data tier we scale up first as scaling out at this level requires more effort.


The application design outlined above can definitely scale and service the needs of many customers.  I’ve built many applications based on this architectural pattern and they work great!  They are all limited in their ability to scale however, at some point there are limits!

These apps are all built with some “expectation of traffic usage”

  • Can this app handle 10 users at once, sure…
  • Can this app handle 100 users at once, sure…
  • Can this app handle 1,000 users at once, yes, but we need the load-balancer now and have to scale out the web tier.
  • Can this app handle 10,000 users at once, probably not.  The main bottleneck will become the Business and Data tier.  This is where data concurrency needs to be maintained.   Relational style databases allow for the most efficient storage of data, but not the most efficient querying of data at scale.

To maintain accuracy, relational databases have to lock data while it’s accessed and updated to ensure atomicity, but in doing so cause a bottleneck due to the locks.

To avoid this problem, new types of storage systems have been created.  A No-SQL database can work much faster. Redis, No-SQL, Azure Document DB are all examples of these new storage mechanisms.  They change the way data is stored and accessed so there are no more locks and concurrency can be maintained.

They accomplish this by “de-normalizing” the data storage, storing data in a “document” vs a series of related tables.  This does help with speed, but sacrifices normalization, leading to more duplicated data.  This is the needed trade-off however, this eliminates the “database locks” we experience trying to scale our 3 tier application.

Now imagine building a system where you need to support 10,000 IoT devices that are all connected to your application and are uploading telemetry data every second. Quickly the model we’ve used to build applications for the last few decades will no longer scale effectively.


Not only is there a scalability limit to the 3 tier application design model, it also makes updates to the application a difficult process that requires you update the entire tier every time you have updates.

This leads to less frequent updates that need to be tested to ensure functionality, many times needing to test large areas of the application.

Microservices is a new term to describe a cloud application development model where the components can still be logically grouped into a “tier” from its responsibility level but separated into a “micro-service” that can be updated and scaled independently.

Breaking the monolith in microservices

These “Microservices” can then be scaled independently based on the demand a particular service is under at any given moment.  Each component can be versioned and upgraded independently.

The Service Fabric application model

These types of applications are now possible utilizing Container solutions like Docker, Docker Swarm , Kubernetes, Azure Service Fabric or MesoSphere DC/OS.  Each of these provide a “Cluster of Vm Nodes” in which the orchestration service can host your application’s microservices.

Cluster of servers with deployed microservices

These technologies leverage Azure Container Service to provide a microservice’s operating environment and make managing a cluster of services easier.

Each microservice agrees to provide information about it’s health to the container orchestration service.  This way the service can effectively manage the scale and updates of each micro-service.

COM+ and DCOM returns?

Utilizing a “micro services” architecture is not a “new concept”, In my 2001 copyrighted COM+ book (not sure why I still have this book)


An advantage of COM+ was that it could be run in “component farms”. Instances of a component, if coded properly, could be pooled and reused by new calls to its initializing routine without unloading it from memory. Components could also be distributed (called from another machine). COM+ and Microsoft Visual Studio provided tools to make it easy to generate client-side proxies, so although DCOM was used to make the remote call, it was easy to do for developers. COM+ also introduced a subscriber/publisher event mechanism called COM+ Events, and provided a new way of leveraging MSMQ (inter-application asynchronous messaging) with components called Queued Components. COM+ events extend the COM+ programming model to support late-bound (see Late binding) events or method calls between the publisher or subscriber and the event system.

Typical COM components would receive an event from a Message Queue or be invoked through MTS.  These COM+ services typically would access the database, perform some types of transaction and respond with their own message or event.

So whats changed?  How are microservices different / better than COM+?   In a nutshell, the context has changed to the cloud!

A New Context – Microservices in the PaaS layer

Modern Microservices can take advantage of the service offerings from the PaaS layer.  Storage, Messaging, Load Balancing, Scale are all benefits gained by providing microservices access to PaaS services.

In this new context, microservices can scale almost infinitely!

These systems can scale to establish bi-directional communication with billions of devices!

Infinite Scalability

There is no such thing as Infinite scalability.  Processes eventually run on physical hardware which has finite limits.  However, these limits no longer constrain application design!

Data, Data, everywhere!

Bryan Krzanich the CEO of Intel recently discussed how Intel is changing focus to support this new ecosystem of devices.

Bryan said:

“There are five core beliefs that I hold to be undeniably true for the future.

  • The cloud is the most important trend shaping the future of the smart, connected world – and thus Intel’s future.
  • The many “things” that make up the PC Client business and the Internet of Things are made much more valuable by their connection to the cloud.
  • Memory and programmable solutions such as FPGAs will deliver entirely new classes of products for the data center and the Internet of Things.
  • 5G will become the key technology for access to the cloud and as we move toward an always-connected world.
  • Moore’s Law will continue to progress and Intel will continue to lead in delivering its true economic impact.

Our strategy is based on these premises, and the unique assets that only Intel brings to them. There is a clear virtuous cycle here – the cloud and data center, the Internet of Things, memory and FPGAs are all bound together by connectivity and enhanced by the economics of Moore’s Law.”

Intel CEO Brian Krzanich has predicted that by 2020, the Internet of Things will include 50 billion devices and each user of those gadgets will generate 1.5 gigabytes of data every day. But, he has said, the average autonomous car will create about 40 gigabytes of data each minute.

How can we possibly collect and process that much data?  We can’t without changing the way applications are designed.


The reason I talked earlier about the Industrial revolution and outlined a timeline of technology progress is I see this as a huge shift in application design.  Similar to the way Electrification changed the way factories were built, allowing economies of scale to be developed with infinite, on-demand usage of power.  The same is true for the Cloudification of Microservices (if that’s a word)

My entire career in computing, I’ve seen the transformation not only in the work I do day to day, but the underlying platform in which we build applications shift.

The shift to Microservices in the cloud taking advantage of PaaS services is truly a game changer!

Microservices in the cloud now provide companies almost infinite resources in the cloud,  on-demand.  In the future, I think people will look back to this moment in history and see it had profound implications on the future.

Businesses today can’t live without information.  Information helps businesses provide better customer service, more efficient and cost effective operations.  This helps businesses to grow and deliver value to their shareholders.

Companies that takes advantage of these new application design paradigms will be able to more efficiently make use of the compute resources available to scale and grow their businesses.

For companies that don’t take advantage of these services, the world will become harder and harder to do business in.

A business’s technology needs to be flexible, adaptable, and cost efficient to maintain and enhance value.  If a company can’t change, or change takes too much time and resources they will surely fail to deliver on the value expected by their customers.

How can Solid Cloud help your business become more efficient in the cloud?  Let us help you start taking advantage of the cloud!


Miniaturization –

Information Age –

Electrification –

By John Aplessed – Own work, Public Domain,

By Myworkforwiki – Own work, CC BY-SA 4.0,

By Sam Johnston – Created by Sam Johnston using OmniGroup’s OmniGraffle and Inkscape (includes Computer.svg by Sasa Stefanovic)This vector image was created with Inkscape., CC BY-SA 3.0,

Microservices: An application revolution powered by the cloud

COM+ programming with Visual Basic – Copyright 2001 O’Reilly and associates.


SQL Server vs Azure SQL

Recently, I helped a customer with a seasonal website that was having performance problems after moving it to Azure.  Last year the site was hosted on-premise and ran fine, but this year he moved the application to Azure and just “felt like” it was running slower.

I did a basic analysis of his Azure footprint.

Redis Cache, Azure SQL Server, 3 WebApps, 2 storage accounts.  The customer has ramped Azure SQL up to the P4 pricing tier to try and increase DB performance.

At first I considered the underlying storage account.  When running SQL Server on a Virtual Machine (Iaas) the type of storage account you choose can significantly affect performance!

Microsoft warns:

Standard Storage has varying latencies and bandwidth and is only recommended for dev/test workloads. Production workloads should use Premium Storage.

Looking at the customer’s storage accounts they were all standard!

But wait, the customer is using Azure SQL, NOT Sql on a VM.  So does the storage matter?  Not with Sql Azure…

3 tiers of service are available:

Service tier Target workloads
Basic Best suited for a small database, supporting typically one single active operation at a given time. Examples include databases used for development or testing, or small-scale infrequently used applications.
Standard The go-to option for most cloud applications, supporting multiple concurrent queries. Examples include workgroup or web applications.
Premium Designed for high transactional volume, supporting many concurrent users and requiring the highest level of business continuity capabilities. Examples are databases supporting mission critical applications.

Sql Azure measures performance in DTUs – Database Transaction Units

You can customize your instance depending on your desired performance level.

Basic service tier

Service tier Basic
Max DTUs 5
Max database size 2 GB
Max in-memory OLTP storage N/A
Max concurrent workers 30
Max concurrent logins 30
Max concurrent sessions 300

Standard service tier

Service tier S0 S1 S2 S3
Max DTUs 10 20 50 100
Max database Size 250 GB 250 GB 250 GB 250 GB
Max in-memory OLTP storage N/A N/A N/A N/A
Max concurrent workers 60 90 120 200
Max concurrent logins 60 90 120 200
Max concurrent sessions 600 900 1200 2400

Premium service tier

Service tier P1 P2 P4 P6 P11 P15
Max DTUs 125 250 500 1000 1750 4000
Max database size 500 GB 500 GB 500 GB 500 GB 1 TB 1 TB
Max in-memory OLTP storage 1 GB 2 GB 4 GB 8 GB 14 GB 32 GB
Max concurrent workers 200 400 800 1600 2400 6400
Max concurrent logins 200 400 800 1600 2400 6400
Max concurrent sessions 30000 30000 30000 30000 30000 30000


OK, so how many DTU’s do I need?  How is this measured?  Luckily Microsoft provides a DTU Calculator

This tool can help you analyze the workload of your Sql server over a 1 hour period to gather performance metrics.

You can feed this data into the DTU Calculator.  After clicking the calculate button, you’ll see several charts which provide an analysis of your database resource consumption. The charts depict the percentage of time (based on your measurements) that your database’s resource consumption fits within the limits of each Service Tier and Performance Level.  You can review CPU, Iops, and Log individually as well as collectively to better understand which metrics affect the performance of your database.

Azure also provides Sql Db Elastic pools.  SQL DB elastic pools provide a simple cost effective solution to manage the performance goals for multiple databases that have widely varying and unpredictable usage patterns.

In a nutsell, Azure SQL scalability levels are off the charts!  You can Scale SQL server from 1 small instance with 5 DTUs at $5 / month to P15 with 4000 DTUs at $16,000 / month.

Based on this customers usage patterns – 40-50 users and 100 more on the webapp.  This SQL server was way over scaled at P4!  But why was it running so poorly?

Luckily Azure SQL also provides some utilities to help look into your Azure Sql database performance


Selecting your Azure Sql database in the Azure Portal , find the Support & Troubleshooting section.  The performance overview and recommendations can help you.  In this customer’s case:


The system was recommending I add indexes, I can even enable Automatic Tuning and have it create the indexes for me next time!

Indexes are critical to relational database server performance.  It wasn’t clear how the database got moved from on-premise last year to in Azure this year, but since they converted it to Sql Azure, they probably re-created the database schema and imported the data.  Sql Azure and Sql have different levels of flexibility. They must have forgot the indexes!

I recommended the customer apply the suggested indexes after hours to improve performance.  I also recommended he move back to an S2 or S3 instance size which should work fine for his workload once the database is tuned properly.

The next day the customer reported better performance.

Should you use Sql Azure or Sql Server?

When you create a database in Sql Azure, you have no control over database files and disk placement. The service imposes resource thresholds so that any bad behavior doesn’t upset the neighbors. With Azure SQL Database, you can move in quickly, but you can’t play music too loud or tear down any walls. If you need a low-maintenance environment with basic functionality, Azure SQL Database may be right for you.

SQL Server

SQL Server, on the other hand, is like owning your own home. It offers full functionality and the freedom to build your environment any way you like.  With that freedom comes responsibility, however. IT staff must administer all infrastructure, including the physical hardware, network, disk configuration, SQL Server configuration, backups, security and disaster recovery. If your organization requires a high degree of control and has the expertise to do it, traditional SQL Server may be your best choice.

SQL Server on Azure VM

Want to eliminate some of the hassle of upkeep and maintenance? SQL Server on an Azure VM offers a hybrid solution. The hardware and operating system provisioning and maintenance is done for you, but the SQL Server itself is fully under your control. Like owning a condo, you can paint the walls and renovate the kitchen, but never have to worry about mowing the lawn or fixing the roof. For those that want the best of both worlds, SQL Server on an Azure VM offers a viable solution.

The choice depends on what you need, when you need it, and how much you are willing to invest. Azure SQL Database, on-premise SQL Server, or SQL Server on Azure VM: one of them will work for you.

Why hosting your website on Azure is better than hosting it anywhere else!

The Microsoft Cloud offers huge advantages over other platforms to host your web based applications.  This article outlines several advantages to hosting your website or web application in Microsoft’s Cloud.

Multiple Deployment Slots

Built into Microsoft’s cloud is the ability to create “Deployment Slots” to stage your web content for testing. (Standard or Premium plan)

You can create up to 5 slots, (think Dev, Integration, QA, Staging, Production) environments that allow you to isolate and test new versions of your website before going live.  (up to 20 slots in Premium!)

Deploying a web app to a slot first and swapping it into production ensures that all instances of the slot are warmed up before being swapped into production. This eliminates downtime when you deploy your web app.

Each slot gives you a unique Url to test this specific version of your web application.


This also lets you test new changes and updates without breaking your existing website.  You can simply swap slots with production to make your new version live!

Dynamic Scaling

How many servers do you have, how many do you need?  What if you want to do a big advertising campaign or social campaign, can your website handle the traffic?  Do you know it can?  Or are you guessing?

Azure lets you Scale Up (add CPU and Memory) or dynamically Scale Out ( add additional servers) automatically or on a schedule.


This helps you make sure your website or application is highly available to handle inbound web traffic when needed.  Got an upcoming event?  It’s nice to know that your website can automatically scale to meet that demand and you won’t be wasting advertising dollars because your website is overloaded!

Traffic Manager

How are you treating your customers around the globe?  If you are selling a product or service online, you need to consider how well your website works in different regions around the world!

Now only can Azure help you test how your site is actually performing from various locations around the world, it can help you scale your site geographically as well.


Azure CDN

Microsoft Azure data centers also have a Content Delivery Network (CDN) built-in that you can utilize for your applications.  A CDN puts your website content, (images, videos, scripts, etc)  closer to the user geographically.  This enabled your website to load much faster as the needed resources to display your website can be distributed in different data centers around the world.


Proactive detection & Alerts

Do you wait for your customers to tell you your website is down or not working properly?  By that time you will have lost plenty of business and maybe even customers!

Azure has built in Proactive detection and alerting to notify you if there are problems with your website.  This helps you identify problem areas and key ways to make your website better!


I don’t like Microsoft or Windows!

Fine, be that way..  Does Apple have a service like this?  Nope.. It’s ok to use your Mac, I understand.  You can still use Azure..

Azure supports .Net, Node.js, PHP, Python, and Java applications.  So you can host your stuff in Azure, but still use your Mac.  Happy?  It’s just a laptop, get over it already..

Why wait any longer?

The Microsoft Cloud continues to get better!  Microsoft has made huge investments in their cloud infrastructure and it’s really starting to show!

Move your website to the cloud today!  Don’t wait any longer!  You can’t afford to do business without the built-in tools and features of the Microsoft Cloud Platform.

Make the move, let Solid Cloud help!  We are Microsoft Azure Cloud Experts and would love to help you get the benefits the cloud can offer your business today.


T4 Code Generation

Originally posted on:

I am doing a presentation tomorrow on T4 templates.

T4 code generation – Intro to the Microsoft Text Template Transformation Toolkit (T4)

Microsoft’s T4 toolkit which is built into Visual Studio can help you quickly generate classes, methods or other types of code files. Now’s the time to introduce code generation to your company. If you’re doing something twice or more, manually, in your company, generate it! T4 templates can help you generate tons of code! You can use T4 to generate Entity Models, Database Structures or entire facades!

This .zip contains my power point presentation and a few sample projects I put together.