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
Infrastructure as Code with Azure Bicep

You're reading from   Infrastructure as Code with Azure Bicep Streamline Azure resource deployment by bypassing ARM complexities

Arrow left icon
Product type Paperback
Published in Feb 2022
Publisher Packt
ISBN-13 9781801813747
Length 230 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Yaser Adel Mehraban Yaser Adel Mehraban
Author Profile Icon Yaser Adel Mehraban
Yaser Adel Mehraban
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Getting Started with Azure Bicep
2. Chapter 1: An Introduction to Azure Bicep FREE CHAPTER 3. Chapter 2: Installing Azure Bicep 4. Chapter 3: Authoring Experience 5. Chapter 4: Compiling and Decompiling Bicep Files 6. Section 2: Azure Bicep Core Concepts
7. Chapter 5: Defining Resources 8. Chapter 6: Using Parameters, Variables, and Template Functions 9. Chapter 7: Understanding Expressions, Symbolic Names, Conditions, and Loops 10. Chapter 8: Defining Modules and Utilizing Outputs 11. Section 3: Deploying Azure Bicep Templates
12. Chapter 9: Deploying a Local Template 13. Chapter 10: Deploying Bicep Using Azure DevOps 14. Chapter 11: Deploying Bicep Templates Using GitHub Actions 15. Chapter 12: Exploring Best Practices for Future Maintenance 16. Other Books You May Enjoy

Compiling Bicep files

In this section, you will learn how to compile your Bicep files. The simplest way in which to compile your Bicep file is by using the Bicep CLI. By now, you should have it installed and ready to use.

Compiling a Bicep file using the Bicep CLI

The Bicep CLI has a build command that compiles a Bicep file and produces an ARM template. Create a new empty file and rename it main.bicep. You can also use the following command in both Linux and macOS:

ECHO >> main.bicep

Following this, open a terminal where the file is located and run the following:

bicep build main.bicep

This will produce the following output inside a file called main.json:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
     ...
lock icon The rest of the chapter is locked
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 R$50/month. Cancel anytime