hands-on lab

Using Parameters and Variables with Azure Bicep Templates

Beginner
45m
279
4.4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

Storing reusable and often referenced values is one of the many best practices when using Infrastructure-as-Code (IaC). It makes it easier to author IaC templates and increases readability, so you do not have huge expressions taking up a lot of space in the template's body. Azure Bicep Templates use parameters and variables to achieve this. Using parameters and variables is the first step to making neater templates and is a security recommendation to avoid hard-coding secure values such as passwords.

In this lab, you will learn how to use parameters and variables in a Bicep template.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Understand the benefits of using parameters and variables
  • Store and reference complex expressions using parameters and variables
  • Store parameters in a separate, connected parameters file 

Intended Audience

  • Students who have taken the Introduction to Azure Bicep Templates lab and want to extend their knowledge
  • IT professionals interested in Infrastructure-as-Code
  • IT professionals interested in the next generation of ARM Templates
  • Cloud Engineers
  • Cloud Architects
  • DevOps Engineers

Prerequisites

Familiarity with the following will be beneficial:

  • Azure Web App concepts.
  • Familiarity with the Azure CLI.
  • Familiarity with the structure of Azure Bicep Templates is highly recommended.

The following labs can help to fulfill the prerequisites:

Environment before
Environment after
About the author
Avatar
Adil Islam
Cloud Labs Developer
Students
7,286
Labs
39
Learning paths
1

Adil is a Microsoft Certified Trainer, former Azure Engineer, and loves all things Azure. He is a certified Azure Administrator and Azure DevOps Expert and has worked for some of the biggest MSPs in the world (Cognizant, New Signature, CoreAzure). He loves to combine his two passions: cloud and teaching.

Adil specializes in Azure Infrastructure services and has a curiosity for new, in-preview services from Azure, getting his hands familiar with the content before most of the world does. Outside of work, Adil helps run a growing community of IT professionals looking to break into the cloud and regularly runs workshops and webinars.

Covered topics
Lab steps
Passing Reusable Information to Bicep Templates Using Parameters
Referencing Stored Information in a Template with Variables
Logging into Azure using Azure CLI
Integrating Parameters and Variables within a Bicep Template