Ends in
00
days
00
hrs
00
mins
00
secs
ENROLL NOW

$2 OFF in ALL Azure Practice Exams & NEW AZ-500 Microsoft Azure Security Engineer Associate Practice Exams at $10.99!

Automate Resources In Azure Using ARM Templates

Home » Azure » Automate Resources In Azure Using ARM Templates

Automate Resources In Azure Using ARM Templates

Last updated on April 27, 2023

Infrastructure as Code (IaC) is a method of running IT infrastructure that automates, configures, and manages systems and networks using scripts or code. It can work with a variety of file formats, including JSON and YAML. YAML (YAML Ain’t Markup Language) is a data serialization format that is commonly used in Ansible, Kubernetes, and other tools. While JSON (JavaScript Object Notation) is a popular data interchange format that is frequently used in AWS CloudFormation, Terraform, and other tools. Both YAML and JSON are simple to understand and can be used in a variety of IaC tools.

Azure Resource Manager (ARM) templates is a service provided by Microsoft Azure that allows you to provision, manage, and delete Azure resources using declarative syntax. These templates can be used to deploy and manage resources such as virtual machines, storage accounts, and virtual networks in a consistent and reliable manner. To deploy the template, you can use the Azure Portal, Azure CLI, or Azure PowerShell.

In this article, we’ll use the Azure Portal to create, deploy and export resources using ARM templates:

Deploying ARM templates

  1. The first thing you need to do is to search for the service “Deploy a custom template”. After selecting the service, you’ll see the options:

  • Build your own template in the editor

  • Tutorials dojo strip
  • Common templates

  • Start with a quickstart template or template spec

Automate Resources in Azure using ARM templates

2. Begin with a quickstart template, then type “docker-simple-on-ubuntu” and press Next. Add the required parameters, such as resource group, username, DNS, and password, then click Create.

3. You can also modify the template based on your requirements before creating the resources.

Automate Resources in Azure using ARM templates

4. Once the deployment is successful, you can go to the selected resource group, and you’ll see the created resources from the ARM template.

Automate Resources in Azure using ARM templates

5. When the Azure resources are no longer needed, you can clean up the resources by deleting the resource group.

Exporting Template

If you want to save the current state of the resource group, scroll down to the Automation section and click Export template, then click the download button.

Automate Resources in Azure using ARM templates

Before re-using the template for production deployments, you may want to revise it since the template we used is a quickstart template.

Creating ARM templates

1. Now that you’ve learned how to deploy using a quickstart template, let’s now try creating an ARM template from scratch. Go back to the “Deploy a custom template” page and click Build your own template in the editor.

Automate Resources in Azure using ARM templates

2. Once you are redirected to the editor page, you’ll see that there are no parameters, variables, and resources. In this section, we’ll create and deploy an Azure web app template. 

3. Click Add resource, select Web app, fill up the remaining fields and press OK.

Automate Resources in Azure using ARM templates

4. In the editor page, you’ll notice that a JSON has been created. Feel free to change any of the parameters based on your requirements.

Automate Resources in Azure using ARM templates

5. If you want to save the template you’ve created, just click the Download button. Now let’s save the template, and you’ll be redirected to the configuration of the resource. Just fill up the required fields and click Create.

Automate Resources in Azure using ARM templates

6. After the deployment is completed, you can go to the resource group and select the web app you’ve created. To confirm if the web app is running, you can access the URL generated by the App Service. The format is: https://<web-app-name>.azurewebsites.net/

Automate Resources in Azure using ARM templates

7. That’s how simple it is to create and deploy a custom ARM template for your own project. Again, if you no longer need the resource, don’t forget to delete the resource group to avoid unexpected billing in your account.

$2 OFF in ALL Azure Practice Exams & NEW AZ-500 Microsoft Azure Security Engineer Associate Practice Exams at $10.99!

Tutorials Dojo portal

Be Inspired and Mentored with Cloud Career Journeys!

Tutorials Dojo portal

Enroll Now – Our Azure Certification Exam Reviewers

azure reviewers tutorials dojo

Enroll Now – Our Google Cloud Certification Exam Reviewers

Tutorials Dojo Exam Study Guide eBooks

tutorials dojo study guide eBook

FREE AWS Exam Readiness Digital Courses

Subscribe to our YouTube Channel

Tutorials Dojo YouTube Channel

FREE Intro to Cloud Computing for Beginners

FREE AWS, Azure, GCP Practice Test Samplers

Recent Posts

Written by: Gerome Pagatpatan

Gerome is a Software Engineer with 5 cloud certifications from Amazon Web Services, Microsoft Azure, and Oracle. He co-authored high-quality educational materials in the cloud computing space, which have been used by over a quarter-million people worldwide. He is also part of the AWS Community Builders program, which aims to help fellow IT professionals advance their careers in the cloud. He is passionate about education, and now it's his turn to share his knowledge, experiences, and passion for cloud computing.

AWS, Azure, and GCP Certifications are consistently among the top-paying IT certifications in the world, considering that most companies have now shifted to the cloud. Earn over $150,000 per year with an AWS, Azure, or GCP certification!

Follow us on LinkedIn, YouTube, Facebook, or join our Slack study group. More importantly, answer as many practice exams as you can to help increase your chances of passing your certification exams on your first try!

View Our AWS, Azure, and GCP Exam Reviewers Check out our FREE courses

Our Community

~98%
passing rate
Around 95-98% of our students pass the AWS Certification exams after training with our courses.
200k+
students
Over 200k enrollees choose Tutorials Dojo in preparing for their AWS Certification exams.
~4.8
ratings
Our courses are highly rated by our enrollees from all over the world.

What our students say about us?