37,19 €
It’s no secret that developers don’t like using JSON files to declare their resources in Azure because of issues such as parameter duplication and not being able to use comments in templates. Azure Bicep helps resolve these issues, and this book will guide you, as a developer or DevOps engineer, to get the most out of the Bicep language.
The book takes you on a journey from understanding Azure Resource Manager (ARM) templates and what their drawbacks are to how you can use Bicep to overcome them. You will get familiar with tools such as Visual Studio Code, the Bicep extension, the Azure CLI, PowerShell, Azure DevOps, and GitHub for writing reusable, maintainable templates. After that, you’ll test the templates and deploy them to an Azure environment either from your own system or via a continuous integration and continuous delivery (CI/CD) pipeline. The book features a detailed overview of all the Bicep features, when to use what, and how to write great templates that fit well into your existing pipelines or in a new one. The chapters progress from easy to advanced topics and every effort has been put into making them easy to follow with examples, all of which are accessible via GitHub.
By the end of this book, you’ll have developed a solid understanding of Azure Bicep and will be able to create, test, and deploy your resources locally or in your CI/CD pipelines.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 181
Veröffentlichungsjahr: 2022
Streamline Azure resource deployment by bypassing ARM complexities
Yaser Adel Mehraban
BIRMINGHAM—MUMBAI
Copyright © 2022 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Rahul Nair
Publishing Product Manager: Niranjan Naikwadi
Senior Editor: Athikho Sapuni Rishana
Content Development Editor: Sayali Pingale
Technical Editor: Shruthi Shetty
Copy Editor: Safis Editing
Associate Project Manager: Neil Dmello
Proofreader: Safis Editing
Indexer: Sejal Dsilva
Production Designer: Sinhayna Bais
Marketing Co-Ordinator: Nimisha Dua
First published: December 2021
Production reference: 1151221
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80181-374-7
www.packt.com
To my wife, Rosa, for her sacrifices and for exemplifying the power of determination. To my mom, Sedigheh; there are no words that can express how I feel, and I thank you for what you made me. And to my two little angels, Ronika and Elika; please listen to what your mom says.
– Yas
It's hard to overstate the benefits of defining your solution's Infrastructure as Code (IaC). Continuous delivery, continuous testing, quality control gates, automated security testing, and automated performance testing all benefit from having an automated approach to working with infrastructure.
Until recently, the gold standard of IaC on Azure has been ARM templates. It's fair to say that nobody particularly likes working with its arcane JSON syntax. As a result, it's been difficult for Azure customers to unlock all of the benefits of IaC. But with the introduction of Bicep, defining IaC for Azure hasn't just become easier – it's become fun.
In this book, Yas has taken his wealth of experience and combined a tutorial of the Bicep language with reference material covering its keywords and syntax. There is a lot of practical advice, too, with tips for using the Bicep tooling for Visual Studio Code and the Bicep linter. And to really get the best out of Bicep and IaC, look at the chapters about deployment pipelines and some recommended practices for writing good code.
I often say that Bicep has changed the game of Azure deployments. After you read this book, you'll have a solid foundation for planning your own automated deployment process for Azure.
– John Downs
Senior Customer Experience Engineer at Microsoft
It comes as no surprise that Yas has decided to put pen to paper and produce this book on IaC with Azure Bicep. As you read this, what will become evident is his passion for technology, innovation, and for helping people and organizations be their best. I have had the pleasure of working with Yas as his manager and seen his passion firsthand. He has an amazing way of breaking down the complex, evoking thought, discussion, encouraging ideas, and promoting self-belief. This stems from his upbringing and desire to achieve and bring out the best in himself and turn dreams into reality, with no better example of now achieving his goal of one day working for Microsoft.
I know you will enjoy the book as much as I have. You will be inspired by the level of detail and benefit from Yas's shared expertise.
– Edmondo Rosini
Director, Azure Technical Training at Microsoft
Yaser Adel Mehraban is a self-taught and motivated software engineer and solution architect who lives in the most livable city in the world, Melbourne, Australia. He is currently working as an Azure technical trainer for Microsoft. Some might know him as the almond croissant addict cleverly disguised as a successful web developer.
He has over a decade of experience working in a variety of different teams and has helped them adapt DevOps and IaC to be able to increase team productivity when it comes to cloud resource deployment. Furthermore, he has a true passion for sharing knowledge, which has motivated him to give many international conference talks, write hundreds of technical blog posts, and publish courses on platforms such as Pluralsight.
When he is not working, he mostly spends his time with his family or on his woodworking projects, which vary depending on how much space is left in the house.
– I would like to thank Niranjan (project manager) who approached me at the start and has supported me throughout the entire writing process. In addition, I would like to thank Neil (project manager and editor) and Sayali (editor) for their dedication and support to help me write this book smoothly from start to finish. Also, thanks to the technical reviewers, Vaibhav and Alessandro, for their help in spotting my mistakes and validating the technical aspects, which adds so much to the book's practicality. And finally, thanks to my dear friends, John and Edmondo, who have expressed their support through their precious words about me and the book.
Vaibhav Gujral is a thought leader and a seasoned cloud architect with over 15 years of extensive experience working with several global clients spanning multiple industries. In his current role, he is responsible for envisioning and creating enterprise cloud strategy and continually building and improving the cloud platform foundations that development teams build upon. Born and brought up in India, he has been based out of Omaha, NE, since 2016. Vaibhav holds a bachelor of engineering degree and is a Microsoft Azure MVP. He is also a Microsoft Certified Trainer and holds numerous Azure role-based certifications. He is a regular speaker at several user groups and conferences, and he also runs the Omaha Azure user group.
– I'd like to thank my wife, Geeta, and our two children, Saanvi and Rihaan, for their daily support and patience. I'd like to thank my parents, siblings, relatives, friends, and mentors for their guidance and continued support. Finally, I'd also like to thank Packt Publishing for the opportunity to review this book.
In this section, as well as an introduction to Bicep and getting started, you will also learn how to create your first template, compile Bicep files, and convert ARM templates to Bicep.
This part of the book comprises the following chapters:
Chapter 1, An Introduction to Azure BicepChapter 2, Installing Azure BicepChapter 3, Authoring ExperienceChapter 4, Compiling and Decompiling Bicep FilesIn this chapter, you're going to learn what Azure Bicep is, and you'll get a quick bit of background on why it was created and what problems it is trying to solve. There will be a comparison with its predecessor, ARM templates, and at the end, you will learn about some of its limitations.
This chapter will give you insights into the reason why Microsoft went to all the trouble of creating Azure Bicep, even though there are already many different third-party tools out there with similar functionalities and feature sets. It is important to learn the reasoning to be able to learn the language without any bias and make practical use of its powerful features.
In this chapter, we are going to cover the following main topics:
What is Azure Bicep?Why was it created?How does it work?To make the most of this chapter, you will need to have a basic understanding of Infrastructure as Code (IaC), Azure ARM templates, and the Azure CLI. The code used throughout this chapter is stored in this GitHub repository: https://github.com/PacktPublishing/Infrastructure-as-Code-with-Azure-Bicep/tree/main/Chapter01.
In this section, you will learn Azure Bicep and what it offers to developers and DevOps teams. There will be a few code snippets to get your eyes familiar with the syntax and, finally, an overview of its components and building blocks. But before we begin, let's review some concepts to make sure we are on the same page.
Currently, many companies try to automate their infrastructure creation and maintenance. To do that, and to further keep track of what is happening or has happened in their environments, they use a set of scripts or code files alongside tools and processes that streamline the whole deployment for them.
This practice is called IaC and helps every team to safely establish and configure the required infrastructure for their applications and solutions. This practice became even more simplified when all cloud providers added the ability for their customers to use it, which in terms of Microsoft is called Azure Resource Manager (ARM
