Azure Resource Group & ARM Template - part 01

Shalika Prasad
5 min readAug 9, 2020

This is my first article related to Build Your First Azure Web Application.

What is the Resources?

When you go to azure, you want to purchase services like Web App, SQL Databases, a VM. It doesn’t matter which services that you buy. These all services are represented as a generic object called resources. As well as, this resources like an objects that are used to represent your services in azure. Azure uses resources to save the configurations that you make that you make for your services. If you have configuration option that you have for your service is represented as a property on that resource.

All the resources in azure can be represented as a JSON (Java Script Object Notation) template. It is a simple file that has properties and values. It is one of the very commonly used standards on the market. You should know about four common properties across all resources like

  • type
  • API version
  • Name
  • Location

Other properties are different from other resources. It used to describe different resources, different services within azure.

What is the Resources Group?

No resources can be created without something called resource group. It is a logical container for only resources. It is requirement in order to create any resources in azure. As well as it can tell as a grouping of resources. But, you should use it to logically group related resources. It has their own location assigned. Resource can be moved between your own resource groups. We cannot create hierarchy of resource groups.

Thus, you can organized your resources by bellow strategies,

  • Type (SQL DBs, Web Apps, Storage Accounts like that)
  • Life-cycle of Application [environment(Linux, Windows), app] — then you can apply different scripts, different policies, different security rules and different access management policies
  • Departments
  • Location based

You can simply create resource group using Resource groups(this is default directory).

  • Click Add button.
  • Add Subscription and resource group name.

Now you can create resources as you like.

When you add any resource, you must add resource group as well.

And also, If you like that you can add a role to access and give permission for your friends to your resources of this resource group.

  • Click Access role tab and click Add role button.
  • Add role that you want to add,
  • Add which access resources types that you want to give permission,
  • Select names, emails who want to add.

What is the ARM Template?

Firstly, we talk about Azure Resource Manager. As a azure customer, you can create resources using different methods as you like.

  • Azure Portal
  • Power shell
  • Azure CLI
  • REST API (you can create scripts and applications that will automate resource deployments)
  • Programming SDKs

However, all of these interfaces connect to the same point to send same template. This point called Azure Resource Manager. It is centralized service governing all the resources in azure. This service responsible for creating each service within azure. It is a centralized management layer for all resource groups and resources. Because it has unified language and everything is consistent across multiple interfaces. So, It is also responsible for checking your privileges with Azure Active Directory. Because, AD is a centralized identity and access management services in azure(It store all privileges of user). That means, Azure resource manager will check with azure id whenever the user that is requesting resource creation, changes or deletions.

As well as, you can download your resources as a template. Now, we talk about which sections include in ARM template.

  • You can download it as zip file. It has two files.
  • This is step for downloading your ARM template. click which resource you want to download as template.
  • Now, it begin to generating template and then after, you can export as template.

Now, I hope to explain little bit of ARM template script.

  • $schema = Describe properties available in the template.
  • Content version = Versioning system in template for development purpose.(If you use git, then it don’t want for you)
  • resource = Array of JSON objects defining for resources.
  • parameters = Definition of input parameters for template parameterize.
  • variable = Definition of dynamic variables for template parameterize.
  • output = Return variable from template execution as template out.
  • functions = Custom JSON expression functions defined by user(can reuse across your template)

Now, We talk about what are the key benefits from using ARM template.

  • Infrastructure as code, policy, Roles as codes
  • Declarative syntax
  • Repeatable result
  • Orchestration(you can ensure quality & order of the resources.
  • Build in validation(you can see some common mistakes from this)
  • Export
  • Dependencies

Now, See part 02 related t this project.

Azure Web App — Angular Front-end Service — part 02

Conclusion

--

--