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

Why Database Modernization Matters for AI

  When companies transition to the cloud, they typically begin with applications and virtual machines, which is often the easier part of the process. The actual complexity arises later when databases are moved. To save time and effort, cloud adoption is more of a cloud migration in an IaaS manner, fulfilling current, but not future needs. Even organisations that are already in the cloud find that their databases, although “migrated,” are not genuinely modernised. This disparity becomes particularly evident when they begin to explore AI technologies. Understanding Modernisation Beyond Migration Database modernisation is distinct from merely relocating an outdated database to Azure. It's about making your data layer ready for future needs, like automation, real-time analytics, and AI capabilities. AI needs high throughput, which can be achieved using native DB cloud capabilities. When your database runs in a traditional setup (even hosted in the cloud), in that case, you will enc...

Cloud Myths: Migrating to the cloud is quick and easy (Pill 2 of 5 / Cloud Pills)

The idea that migration to the cloud is simple, straightforward and rapid is a wrong assumption. It’s a common misconception of business stakeholders that generates delays, budget overruns and technical dept. A migration requires laborious planning, technical expertise and a rigorous process.  Migrations, especially cloud migrations, are not one-size-fits-all journeys. One of the most critical steps is under evaluation, under budget and under consideration. The evaluation phase, where existing infrastructure, applications, database, network and the end-to-end estate are evaluated and mapped to a cloud strategy, is crucial to ensure the success of cloud migration. Additional factors such as security, compliance, and system dependencies increase the complexity of cloud migration.  A misconception regarding lift-and-shits is that they are fast and cheap. Moving applications to the cloud without changes does not provide the capability to optimise costs and performance, leading to ...

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills)

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills) The idea that moving to the cloud reduces the costs is a common misconception. The cloud infrastructure provides flexibility, scalability, and better CAPEX, but it does not guarantee lower costs without proper optimisation and management of the cloud services and infrastructure. Idle and unused resources, overprovisioning, oversize databases, and unnecessary data transfer can increase running costs. The regional pricing mode, multi-cloud complexity, and cost variety add extra complexity to the cost function. Cloud adoption without a cost governance strategy can result in unexpected expenses. Improper usage, combined with a pay-as-you-go model, can result in a nightmare for business stakeholders who cannot track and manage the monthly costs. Cloud-native services such as AI services, managed databases, and analytics platforms are powerful, provide out-of-the-shelve capabilities, and increase business agility and innovation. H...