Preface

The idea to write this book hit me when Azure Bicep was released and after working with ARM templates for quite a while to deploy resources on Microsoft Azure. I truly believe resource deployment should not be complex and infrastructure as code is a must-have for every organization.

In this book, you will start with some basics and a review of Azure ARM templates and why there was a need for a revision to remove some barriers and make it easier for cloud engineers and DevOps teams to deploy their resources using code. From installation to writing your first template in your local development environment, testing, and deploying it locally, you will learn it all. You will find out about Bicep's syntax and how to write maintainable and reusable templates that can be used in your continuous deployment pipelines with ease. And at the end of the book, there are some of the best practices and industry standards that you need to be aware of.

The book is structured in a way that goes from basics to advanced topics so that you will not have any problems following along even if you have not had prior experience with Azure ARM templates or resource deployments via templates before.

Who this book is for

This book targets cloud engineers, DevOps teams, and developers who are responsible for creating their infrastructure as code (IoC) to deploy their resources in their Azure environment.

What this book covers

Chapter 1, An Introduction to Azure Bicep, describes what Azure Bicep is, why it was created, and some of the goals it's trying to achieve.

Chapter 2, Installing Azure Bicep, covers how to install Azure Bicep on different operating systems along with the Azure CLI and Azure PowerShell.

Chapter 3, Authoring Experience, is all about the developer experience when writing Bicep templates in their local development, especially when using Visual Studio Code and its Bicep extension.

Chapter 4, Compiling and Decompiling Bicep Files, covers how to compile Bicep templates to ARM templates before deployment, or if there is an existing ARM template, how to decompile it to a Bicep file.

Chapter 5, Defining Resources, explains how to define resources in a Bicep template, their properties, and dependencies, and some of the language specification that helps you to understand why Bicep is designed the way it is.

Chapter 6, Using Parameters, Variables, and Template Functions, takes you one step further to make your template customizable, remove duplicate expressions using variables, and use the template functions to create better, more reusable templates.

Chapter 7, Understanding Expressions, Symbolic Names, Conditions, and Loops, expands on the previous chapter to help you write template expressions, use logical flows and conditions, and use loops to create a resource multiple times without repeating the syntax.

Chapter 8, Defining Modules and Utilizing Outputs, introduces modules and helps you create modular, reusable templates that not only can be consumed by your own templates but also other teams within your organization. It also reviews template outputs and how to send information about the deployment outside of your templates.

Chapter 9, Deploying a Local Template, starts the process of validating and deploying your templates. Before you start using your templates in your CI/CD pipelines, you need to know how to test and deploy them locally, and that is what you will learn here.

Chapter 10, Deploying Bicep Using Azure DevOps, helps you set up an Azure pipeline to deploy your Azure resources from Azure Repos. It covers not only the creation of the pipeline but also how to add the necessary steps to validate and deploy a Bicep template.

Chapter 11, Deploying Bicep Templates Using GitHub Actions, helps you validate and deploy your Bicep templates from GitHub using a GitHub Actions workflow.

Chapter 12, Exploring Best Practices for Future Maintenance, complements your learning by introducing you to some best practices that will take your Bicep template creation to the next level.

To get the most out of this book

To take full advantage of this book, you will need to have the following list of software installed on your system. You also need to have an Azure DevOps and a GitHub account. Finally, you need to have an active Azure subscription, which you can get for free, all of which is described in the book.

I highly recommend that you follow along with the book to get the best out of it. Also feel free to use other types of resources for your own benefit, and when in doubt, always refer to Microsoft's documentation on Bicep.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Infrastructure-as-Code-with-Azure-Bicep. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/.

Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801813747_ColorImages.pdf.

Conventions used

There are several text conventions used throughout this book.

Code in text: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "If you want to upgrade your Bicep, you can use the upgrade command."

A block of code is set as follows:

resource stg 'Microsoft.Storage/storageAccounts@2021-02-01' = {

name: 'name'

location: resourceGroup().location

kind: 'StorageV2'

sku: {

name: 'Standard_LRS'

}

}

output storageKey string = stg.listKeys().key[0].value

Any command-line input or output is written as follows:

brew update && brew install azure-cli

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "You can find the complete schema for all Azure resources in the Schema section of the Azure documentation."

Tips or Important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you've read Infrastructure as Code with Azure Bicep, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.170.183