Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Azure Strategy and Implementation Guide, Fourth Edition

You're reading from   Azure Strategy and Implementation Guide, Fourth Edition The essential handbook to cloud transformation with Azure

Arrow left icon
Product type Paperback
Published in May 2021
Publisher Packt
ISBN-13 9781801077972
Length 228 pages
Edition 4th Edition
Tools
Arrow right icon
Authors (5):
Arrow left icon
Aaditya Pokkunuri Aaditya Pokkunuri
Author Profile Icon Aaditya Pokkunuri
Aaditya Pokkunuri
Greg Leonardo Greg Leonardo
Author Profile Icon Greg Leonardo
Greg Leonardo
David Rendón David Rendón
Author Profile Icon David Rendón
David Rendón
Jason Milgram Jason Milgram
Author Profile Icon Jason Milgram
Jason Milgram
Jack Lee Jack Lee
Author Profile Icon Jack Lee
Jack Lee
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Introduction 2. Automation and governance in Azure FREE CHAPTER 3. Modernizing with hybrid cloud and multicloud 4. Cloud migration: Planning, implementation, and best practices 5. Enabling secure, remote work with Microsoft Azure AD and WVD 6. Security fundamentals to help protect against cybercrime 7. Offers, support, resources, and tips to optimize cost in Azure 8. Conclusion Index

Deploying Azure IaC

As we saw in the ARM templates section, we want to use ARM templates to deploy our infrastructure, as it fits in nicely with our CI/CD process. There are several ways to approach building out these templates.

One way is to create a monolithic template that contains all of the resources that you want to deploy. To make things a little more modular, you could use a nested template structure. Alternatively, you may want to take a more decoupled approach and create smaller templates that you can link together, making a highly usable and repeatable structure.

Let's take a look at each of these methods, starting with the monolithic view:

Monolithic view of an ARM template

Figure 2.1: Monolithic ARM template

As you can see in Figure 2.1, a monolithic ARM template deploys a UI front end with an API middle tier connected to the SQL database. In this process, we need to build out all of the dependencies within the JSON template. The SQL database is deployed before the API middle tier to use the connection string in the API application configuration. You would then deploy the UI layer with the API URL being used in the UI application configuration. The chaining of the deployment can work not only for deploying code but also helping with the configuration.

Alternatively, you could implement a nested template arrangement:

Nested ARM templates

Figure 2.2: Nested ARM templates

As you can see, this is similar to the structure in Figure 2.1. However, the templates within this structure are nested in separate file sections. This means that each template owns the resource within it that it's trying to deploy. This structure is similar to breaking out your C# code into manageable methods and actions. This follows the same deployment process as discussed in the monolithic scenario, but the files are nested.

The final structure is linked ARM templates:

The final structure—linked ARM templates

Figure 2.3: Linked ARM templates

As you can see, the templates are initially separate and decoupled from each other, and then we link them together in our release pipeline. Linked templates are similar to nested templates, except the files are external to the template and system, whereas the nested templates are included in the same scope as the parent template. This helps with reusability down the line, because the templates are separate files that can be linked to other deployment files.

We should note that with linked or nested templates, the deployment mode can only be set to Incremental. However, the main template can be deployed in Complete mode, so if the linked or nested templates target the same resource group, that combined deployment will be evaluated for a complete deployment; otherwise, it will deploy incrementally. To learn more about ARM deployment modes, visit https://docs.microsoft.com/azure/azure-resource-manager/templates/deployment-modes.

We've seen different ways of using these ARM templates to automate the deployment of infrastructure; now we turn to the benefits of doing so.

You have been reading a chapter from
Azure Strategy and Implementation Guide, Fourth Edition - Fourth Edition
Published in: May 2021
Publisher: Packt
ISBN-13: 9781801077972
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 €18.99/month. Cancel anytime