Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Exam Ref AZ-304 Microsoft Azure Architect Design Certification and Beyond

You're reading from  Exam Ref AZ-304 Microsoft Azure Architect Design Certification and Beyond

Product type Book
Published in Jul 2021
Publisher Packt
ISBN-13 9781800566934
Pages 520 pages
Edition 1st Edition
Languages
Author (1):
Brett Hargreaves Brett Hargreaves
Profile icon Brett Hargreaves

Table of Contents (30) Chapters

Preface 1. Section 1: Exploring Modern Architecture
2. Chapter 1: Architecture for the Cloud 3. Chapter 2: Principles of Modern Architecture 4. Section 2: Identity and Security
5. Chapter 3: Understanding User Authentication 6. Chapter 4: Managing User Authorization 7. Chapter 5: Ensuring Platform Governance 8. Chapter 6: Building Application Security 9. Section 3: Infrastructure and Storage Components
10. Chapter 7: Designing Compute Solutions 11. Chapter 8: Network Connectivity and Security 12. Chapter 9: Exploring Storage Solutions 13. Chapter 10: Migrating Workloads to Azure 14. Section 4: Applications and Databases
15. Chapter 11: Comparing Application Components 16. Chapter 12: Creating Scalable and Secure Databases 17. Chapter 13: Options for Data Integration 18. Chapter 14: High Availability and Redundancy Concepts 19. Section 5: Operations and Monitoring
20. Chapter 15: Designing for Logging and Monitoring 21. Chapter 16: Developing Business Continuity 22. Chapter 17: Scripted Deployments and DevOps Automation 23. Section 6: Beyond the Exam
24. Chapter 18: Engaging with Real-World Customers 25. Chapter 19: Enterprise Design Considerations 26. Mock Exam
27. Mock Answers
28. Assessments 29. Other Books You May Enjoy

Chapter 17: Scripted Deployments and DevOps Automation

In Chapter 16, Developing Business Continuity, we looked at how to ensure our solutions have adequate backups in the event that the unexpected happens.

In this chapter, we continue the operational theme, looking at how we can deploy components into Azure, specifically using scripts, templates, and automation tools.

We will begin by exploring what options are available and then start to investigate in more detail how Azure exposes a series of REST APIs. We will then continue looking at using the APIs via command-line tools and Azure Resource Manager (ARM) templates.

Finally, we will look at how to automate deployments using ARM templates and Azure DevOps, along with a brief overview of agile DevOps processes.

We will specifically explore the following topics:

  • Exploring provisioning options
  • Looking at the Azure RESTful API
  • Choosing between PowerShell and Azure CLI
  • Understanding ARM templates
  • Looking at Azure...

Technical requirements

This chapter will use the Azure portal (https://portal.azure.com) and the Azure DevOps portal (https://dev.azure.com) for examples.

Exploring provisioning options

When building solutions in Azure, the most obvious, and arguably easiest option, is to use the Azure portal.

Although this is great for the quick exploration of components, for learning, or even basic setup, using a manual hands-on approach is difficult to replicate with guaranteed consistency.

What we mean by this is the fact that any manual approach that involves a user clicking buttons or entering information cannot be easily repeated in a way that prevents mistakes from happening. In a traditional on-premises environment, solution builds might be verbosely documented so that other engineers can build the system by following step-by-step instructions.

The major problem with this, aside from the time it takes to write the documentation, is the fact that whoever is following the instructions could very easily enter some information incorrectly, misclick a button, or even miss entire steps.

This can be overcome by opting for a scripted environment...

Looking at the Azure REST API

The first option we will consider is the Azure REST API. All actions on Azure resources are managed through ARM, and this is exposed by a set of APIs. When we perform actions in the Azure portal, we are actually making HTTP calls to the REST APIs.

Information Note

Representational State Transfer (REST) is an architectural pattern that exposes data using a defined set of standards in a text-based format using stateless protocols – that is, information between calls (the state) is not expected to be maintained. A web service that implements this pattern is said to be RESTful.

Other management options such as PowerShell, CLI, and DevOps also just wrap calls to the APIs in a more friendly way; however, you can interact with those APIs directly, as we can see in the following diagram:

Figure 17.1 – REST APIs are used by other services

Any call to the API must use the following URI and format:

https://management.azure.com/<resource...

Choosing between PowerShell and the Azure CLI

When we start to consider automating the deployment and management of resources in Azure, the first option would be using the command line, and here we then have two further options: PowerShell and the Azure CLI.

PowerShell and the CLI are very similar: they both run from a command prompt, they both allow access to the Azure platform, and the commands are also very similar.

Traditionally, PowerShell was only available on Windows computers; however, in recent years, PowerShell has been made available on macOS and Linux platforms. PowerShell has a much broader use than Azure and can be used on Windows platforms to manage and script many processes and Windows management functions.

PowerShell is also extensible: you can build functions, classes, scripts, and modules in a similar fashion to development languages. It is a separate module, called the Az PowerShell module, that enables Azure functionality.

Information Note

The current...

Understanding ARM templates

Just as other tools are simply wrappers for the Azure REST APIs, everything that is built in Azure is defined as an ARM template. Whether you create a service through the Azure portal, PowerShell, REST APIs, or the CLI, ultimately that service is described within an ARM template.

An ARM template is a JSON-based text file and is broken down into the following sections:

  • A header containing $schema, contentVersion, and metadata: As an evolving platform, Microsoft is continually adding new components and adding new capabilities to existing components. For this reason, an ARM template contains information that states the schema and version.
  • parameters: ARM templates can be built to be re-usable by allowing you to define and pass in parameters. These are then added either as a separate parameters file, as command-line arguments, or, when deploying a template within the Azure portal, a parameters form.
  • variables: The variables section enables you to...

Looking at Azure DevOps

Throughout this chapter, we have been looking at how we can encode infrastructure in script files and ARM templates that then allow us to automate deployments using those artifacts. This process is often referred to as Infrastructure as Code (IaC) and fits well with agile-based delivery mechanisms as it provides the ability to build solutions iteratively.

Another related discipline is immutable infrastructure, which dictates that no changes should be made to existing infrastructure. When changes are required, the amendments should be made to the code that describes the system, and the existing infrastructure should then be completely destroyed and then re-deployed using the update code. This not only enforces the use of IaC but it also ensures that any changes are always encoded.

If, therefore, we are building out systems using code, we can start to utilize software development tools and technologies. Together, the tools and processes we employ are called...

Summary

In this chapter, we have seen how everything in Azure can be managed by a series of REST APIs and how these are protected using your Azure account.

We saw how we integrate directly with these APIs or via command-line tools such as Azure PowerShell or the Azure CLI. We also looked at how we can use command-line tools and the Azure portal to automate and standardize deployments with ARM templates, which allow us to set specific configurations.

Finally, we looked at using Azure DevOps to manage and version control code and perform automated, repeatable deployments.

This chapter finishes our look at operations and monitoring. In Chapter 18, Engaging with Real-World Customers, we take our architectures beyond the exam to look at customer considerations, cost optimizations, and what types of challenges we face when dealing with large enterprises.

Exam scenario

MegaCorp Inc. is building a new platform in Azure for customers to view details of their own accounts. The solution will be built over time with regular releases and updates; therefore, the management team wishes to embrace agile development methodologies.

The project team will consist of two teams of developers with five developers in each team, and work will be assigned to each team at the start of every two-week sprint.

The project lead is concerned about developers overwriting each other's code or causing other conflicts. They also want to ensure that there is always a working copy of the core code base at any one time.

Each team has a senior developer who must review any code changes prior to a release. Because the deployment mechanism will change regularly as the solution grows, they also need a way to track and manage changes made to it as well.

Advise on how these requirements can be met as part of the solution design.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Exam Ref AZ-304 Microsoft Azure Architect Design Certification and Beyond
Published in: Jul 2021 Publisher: Packt ISBN-13: 9781800566934
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}