“The way to use Azure Resource Manager Template for Linux Users”

〇Summary 

My name is Ren Fujii, and I am a cloud solution engineer. This article introduces one of the sessions at Microsoft Tech Summit 2018 that I attended, titled, “The way to use Azure Resource Manager Template for Linux Users”. 

 

I will select some of the various topics of the session to introduce and add my opinion from my experiences of my past project where I used Azure Resource Manager Template (ARM Template) 

 

〇What is an ARM Template?  

 

ARM Template is templatized information about resources in the format of JSON, each of which is deployed on Azure Resource Manager (ARM)Model. 

The information of the templates includes dependencies among resources as well as the settings of each resource. 

Not only backing up the structure of existing environments, it lets you duplicate the environments with the same structure repeatedly for other tasks such as “Development” and “Production”. 

 

Note: Services provided on Azure are categorized into two types. The one is the Azure Service Manager (ASM) model, which has been provided since 2010 when Microsoft started Azure. The other is the Azure Resource Manager (ARM) model, which has been provided since 2015. 

〇Introducing the Session 

Topic 1: Separating Parameter files 

In ARM Template, some of the values can be input as a “Parameter File”, separated from the “Main Template File” and referred to it. For example, separating the files like below will prevents their users from unintentionally changing the values of “Main Template File”. 

“Main Template File” has values of mandatory items which are commonly set in a company, and “Parameter File” has values of other items which  depend on each user. 

topics1

Topic 2: Deployment will be timed out in 40 minutes and roll back won’t be executed 

When a deployment succeeds on only a part of resources, its deployed resources will be left in the Resource Group. The deployed resources will be skipped, and only the incomplete resources will be added when another deployment is executed successfully.  

topics2

Topic 3: Dependencies among resources 

Creating multi resources sometimes requires controlling the order of creating them in ARM Template as “dependson”. If nothing is specified in “dependson”, all resources will be always created simultaneously. For example, since virtual machines belong to virtual networks, the virtual networks should be created first. 

topics3

Topic 4: Using Loop processing 

With the function of “Loop processing”, ARM Template can be programmed to be like “Code as an Infrastructure”. For example, it is useful for creating huge number of virtual machines in a clustered environment. Through virtual machines with the same settings are programmed with “Loop processing”, the number of the created virtual machines can be flexibly adjusted as the executed counter of “Loop processing”

topics4

Topic 5: Editing JSON files 

The file can be created in the YAML format, which is popular in Linux users, and be converted into JSON. Since it is often hard to edit JSON files directly.

topics5

〇Additional recommendation from my experiences 

  Topic 1: Separating Parameter files 

In the situations where the number of users is small or the users are limited to a particular team, it is easier to complete everything in “Main Template File” without using “Parameter File”. 

The situations are opposite of the one explained in the session 

 

 Topic 2: Deployment will be timed out in 40 minutes and roll back won’t be executed 

It is recommended to design ARM Template by separating resource types, if the number of created resource types is large. When the separated ARM Templates are changed and tested, the scope of the test will be limited. 

 

 Topic 3: Dependencies among resources 

That is the most important point of designing ARM Template. 

The length of the time until each deployment finishes depends on this point. 

If the order of the created resources is specified, then the next resource will start to be created after the previous one is finished. 

 

Topic 4: Using Loop processing 

This function can bring about the greatest merit in using ARM Template 

In my previous project, I have designed my ARM Template to create more than 100 servers from the same master image and to give the servers such computer names and private IP addresses as they are combined with the serial number. The resource names of virtual machines can also be combined with serial number such as “VM_No1″,”VM_No2”, etc., through using its executing conditions such as the executed counter of “Loop processing” 

 

Topic 5: Editing JSON files 

In addition to the way introduced in the session, Visual Studio Code is also very convenient to edit ARM Template directly since IntelliSense is available. 

 

〇Others 

In addition to the topics explained in the session, I have succeeded in creating virtual machines with an SSH Key as well as with a password for SSH log-in. 

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Google フォト

Google アカウントを使ってコメントしています。 ログアウト /  変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中