Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learn Azure Administration - Second Edition

You're reading from  Learn Azure Administration - Second Edition

Product type Book
Published in Dec 2023
Publisher Packt
ISBN-13 9781837636112
Pages 346 pages
Edition 2nd Edition
Languages
Author (1):
Kamil Mrzygłód Kamil Mrzygłód
Profile icon Kamil Mrzygłód

Table of Contents (23) Chapters

Preface 1. Part 1:Introduction to Azure for Azure Administrators
2. Chapter 1: Azure Fundamentals 3. Chapter 2: Basics of Infrastructure as Code 4. Part 2: Networking for Azure Administrator
5. Chapter 3: Understanding Azure Virtual Networks 6. Chapter 4: Exploring Azure Load Balancer 7. Part 3: Administration of Azure Virtual Machines
8. Chapter 5: Provisioning Azure Virtual Machines 9. Chapter 6: Configuring Virtual Machine Extensions 10. Chapter 7: Configuring Backups 11. Chapter 8: Configuring and Managing Disks 12. Part 4: Azure Storage for Administrators
13. Chapter 9: Configuring Blob Storage 14. Chapter 10: Azure Files and Azure File Sync 15. Chapter 11: Azure Storage Security and Additional Tooling 16. Part 5: Governance and Monitoring
17. Chapter 12: Using Azure Policy 18. Chapter 13: Azure Monitor and Alerts 19. Chapter 14: Azure Log Analytics 20. Chapter 15: Exploring Network Watcher 21. Index 22. Other Books You May Enjoy

Basics of Infrastructure as Code

Even though this book is mostly related to administrative tasks in Azure, some other topics are worth knowing. One of those is Infrastructure as Code – often abbreviated as IaC. You might be wondering why this topic is so important. Is the Azure administrator somebody who deploys infrastructure? Well, while an administrator may be loosely related to infrastructure deployment and configuration, in Azure, you cannot just ignore various ways for provisioning. What’s more, in an advanced Azure environment containing multiple resources, policies, and rules, it’s much easier to leverage infrastructure automation and management using an IaC approach.

In this chapter, we’ll focus on the basics of IaC, which will help you learn topics that will be covered in the next few chapters:

  • What is IaC?
  • ARM templates
  • Migrating to Azure Bicep
  • Using Azure Container Registry (ACR) as a repository of modules

Let’...

Technical requirements

To get the most from this chapter, you’ll need the following components:

The Code in Action video for this book can be viewed at: https://packt.link/GTX9F

What is IaC?

In the previous chapter, we talked about using the Azure CLI and Azure Powershell for managing and deploying Azure resources. We also mentioned that you can use the Azure portal for manual provisioning and configuration. Unfortunately, those methods are not always solutions that allow automation.

Imagine the following scenario – you need to deploy a cluster of virtual machines (VMs) that will be used by some teams for their projects. You could do everything step by step using the Azure portal (the easiest option for beginners as it’ll show you all the necessary resources), use the command line to deploy components one by one, or even prepare a simple shell script that contains all the commands:

az vm create \
    --resource-group <resource-group-name> \
    --name <vm-name> \
    --image Win2022AzureEditionCore \
    --public-ip-sku Standard \
   ...

Exploring ARM templates

ARM templates are the oldest IaC solution for Azure and the most popular (we’re still talking about native solutions). They are based on JSON documents, which can be sent to ARM as deployments. Once a deployment is received by ARM, it parses the document and orchestrates the required changes to our Azure infrastructure.

Template schema

The high-level structure of each template looks like this:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "",
  "apiProfile": "",
  "parameters": {  },
  "variables": {  },
  "functions": [  ],
  "resources": [  ],
  "outputs": {  }
}

As you can see, it contains a couple of blocks that can be used for defining...

Migrating to Azure Bicep

Even though ARM templates have become very popular among people and companies working with Microsoft Azure, they’re hardly an ideal solution. As templates are simply JSON documents, they tend to become too verbose and difficult to maintain over time. It’s also difficult to develop a good ecosystem around such a tool because of the characteristics of JSON being a data format, not a real domain-specific language (DSL).

This is why Microsoft decided to take a step forward and proposed a new tool called Bicep. It is 100% compatible with ARM templates but provides a much smoother DevEx experience, better tooling, and IDE support with clean and easy-to-learn syntax. In this section, we’ll try to learn the main Bicep concepts and compare them to the template we created using ARM templates.

Bicep language

Bicep is a DSL, which is somewhat like the Hashicorp Configuration Language (HCL) language used by Terraform (which is another IaC tool...

Using ACR as a repository of modules

One of the important topics when talking about IaC in a company is building a central registry of modules that can be reused by other teams. Such a registry satisfies a couple of requirements:

  • An authorization mechanism
  • Integration with the chosen IaC tool
  • Easy to use and manage

There are lots of different tools on the market that can act as such solutions, but in this chapter, we’ll focus on using one of the Azure services for that.

What is ACR?

ACR is a managed service in Azure that was originally meant to be a private container repository. You could prepare a container image (for example, Docker) and push it to your instance of ACR. Then, you could set up access policies and allow other users or applications to pull images from your registry.

Throughout ACR’s development, it has gained additional features and functionalities. You can use it to run jobs, store Helm charts, or act as a registry for...

Summary

In this chapter, you learned the basics of IaC. We talked about the use of ARM templates and Azure Bicep, their use cases, and the differences between them. You also had a chance to practice not only deployments but also using remote modules. The last topic is especially important from the point of Azure administration since, in many scenarios, you may need to set up and manage a central repository of modules. Such modules are then used by development teams, so it’s important to set up proper access policies (using RBAC) and think about the proper architecture of such a repository (including networking setup).

In the next chapter, we’ll be starting Part 2 of this book and taking a deep dive into Azure Virtual Networks. This topic will be extremely important to you as networks are part of most Azure solutions and act as one of the core infrastructure components that are used to secure and segment services.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learn Azure Administration - Second Edition
Published in: Dec 2023 Publisher: Packt ISBN-13: 9781837636112
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}