Skip to main content

ARM Scripts - Extending T-shirt size concept

Working with Azure Resource Manager (ARM) deployment scripts as with any other scripts can be a challenge. Especially in the moment when you want to run a deployment script.

Why?
How often did you discover that to be able to run a script you need to specify a lot of parameters? The happy case is when a default value is already specified and even if you don't know what happens behind you don't care and only 'click next button'.
I observed that the number of parameters is directly connected with the size and complexity of the deployment. After a specific threshold, the number of parameters that don't have a default value is high, making almost impossible to run the scripts.
Because of this, complex pre-deployment steps would require a lot of time, especially when it is the first times when you make that deployment or something change.

I remember one time I saw a deployment scripts written in ARM and PowerShell that was a state of an art from the way how it was designed and written. As long as you would be able to understand and specify the correct value of each parameter, the deployment script would create and configure for you an ultra complex system, with more than 1.000 components.
Making the script working by specifying the right value of each parameter is another story.
There were many other configurations, but you made an idea.

VMs T-shirt Size
The T-shirt concept is simple, can be understood by anybody and is extremely useful when you need to specify the tier size.
It's more simple to specify a size of a T-shirt like Small, Medium, Large or X-Large than having to specify the VM size and/or the number of instances.
Without T-shirt size you would need to ask yourself how many instances of a specific VM I need ? 2, 6 or 12? Are 4 or 8 enough? What is the minimal size of a VM that is acceptable, should I use the default one or I need another size?

The T-shirt size resolve this for you. By allowing the person that defines the deployment script to specify the size of T-Shirt for number of VMs and/or for the VM tier.
Number of
"vmsNumber": {
      "small": 2,
      "medium": 6,
      "large": 12   
    }
"vmsSize": {
      "small": A2,
      "medium": A4,
      "large": A8   
    }
In this way, not only the number of parameters is reduced, by also the complexity of parameters is reduced to a basic concept - to words not numbers. Now, based on the load of our system and other parameters we only need to specify small, medium or large.
You might say that this reduces the level of customization - yes, you're right. In the same time, don't forget that not all the time you need this customization and flexibility level. In most of the cases the scenarios are simple and clear.
A great article about this topic can be found on Endjin blog.

T-shirt at next level
T-shirt size helped us to resolve the parameters values, making this value more clear and simple to understand. Even with T-shirt size, the number of parameters was not reduced to much. We still need to specify values for different configurations like:

  • Redundancy levels
  • Replication level
  • VPN type
  • Backup policy
  • Encryption level
  • ... and many more...
But, if we analyze the parameters we will observe very often that there are multiple parameters that are connected between each other. When value of one of parameter is X, another parameter value is Y and so on.
This means that we could group together parameters under a T-shirt model. By having parameters for configuration like:

  • Deployment Size (small, medium, large)
  • Security Level (low, medium, high)
  • Redundancy Level (low, medium, large)
  • ... 
By specifying this values we could have default values for:
  • Deployment Size (small, medium, large)
    • VM Tier and Number
    • DB Tier and Number
    • Service Fabric cluster size
    • App Service Tier
  • Security Level (low, medium, high)
    • Encryption level
    • VPN connectivity (if is not required or not)
    • Routing and firewall configuration of appliances
  • Redundancy Level (low, medium, large)
    • Storage replication
    • DB and VM Backup policy
    • Communication 
As we can see, we can use this simple concept to group other parameters also, making scripts more simple, easy to read and understand.


Conclusion
Being technical persons, we try all the time to make a scripts configurable, adding as many values as possible in the parameters. Often we forget that the person that runs this scripts might not be so technical as we are or to understand all the dependencies between all parameters. 
Offering a deployment scripts with less parameters might be useful especially when our target audience are sciences or persons that are not technical. 

Comments

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(...

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine: threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration: TeamCity .NET 4.51 EF 6.0.2 VS2013 It see...

Navigating Cloud Strategy after Azure Central US Region Outage

 Looking back, July 19, 2024, was challenging for customers using Microsoft Azure or Windows machines. Two major outages affected customers using CrowdStrike Falcon or Microsoft Azure computation resources in the Central US. These two outages affected many people and put many businesses on pause for a few hours or even days. The overlap of these two issues was a nightmare for travellers. In addition to blue screens in the airport terminals, they could not get additional information from the airport website, airline personnel, or the support line because they were affected by the outage in the Central US region or the CrowdStrike outage.   But what happened in reality? A faulty CrowdStrike update affected Windows computers globally, from airports and healthcare to small businesses, affecting over 8.5m computers. Even if the Falson Sensor software defect was identified and a fix deployed shortly after, the recovery took longer. In parallel with CrowdStrike, Microsoft provi...