
Learn bicep from scratch and build infrastructure as code with proof of concept assignments, deploying a storage account and a web app in Azure.
Discover infrastructure as code with Bicep and ARM, including parameters, variables, arrays, and objects. Learn to create storage accounts, web apps, and app services from scratch while understanding Azure basics.
Here we introduce the things we will learn
What is infrastructure as code
Why would you use code ?
Learn how to set up an Outlook.com account to access an Azure free trial, with signup options (Outlook or GitHub), a credit card requirement, and cancellation within 30 days.
What ARM stands for
What can it do for you ?
Watch a hands-on demo of ARM templates, inspecting an exported storage account template, its json structure, and the role of parameter files for Azure deployment.
The problem with ARM
Bicep templates explained
Learn to create a bicep template to deploy a storage account using the resource keyword, specifying name, location, sku, and kind (storage v2) in a hands-on demo.
Install the Azure PowerShell module, learn the commandlets to connect to Azure from PowerShell, and push your Bicep file (via its ARM template) to Azure for testing.
Install the bicep CLI manually for Azure PowerShell, authenticate, and deploy a bicep template to create West Europe storage account with locally redundant storage (storage v2), demonstrating infrastructure as code.
Here we introduce the things we will learn
What are parameters in Bicep
Examples
Discover how to determine when a resource property in Bicep requires a string by checking hover hints and official documentation, using name, location, and skew as examples.
Explore how decorators add descriptions and length constraints to Bicep parameters, and see how deployment prompts reveal min and max length validation.
What are data types and why are they important
A few data types are also mentioned
It is possible to assign default values to our parameters
Explore setting defaults in bicep to simplify deployments, override parameters, and use the dot operator to pull the resource group location for aligning storage accounts.
Learn to add defaults in the lab by specifying a default for the storage account name and a default for the storage account skew.
Add defaults for storage account name and sku, default to standard, and enforce 24-character name length and uniqueness. Use PowerShell to verify connection and deploy resource group with those defaults.
What is a function
What does the uniqueString() function do
Details on how it works
Practice using uniqueString() with resource group id in a Bicep lab, generating a 13-character resource group name, deploying and deleting a storage account to verify name consistency.
What is String Interpolation and why
See how string interpolation in bicep adds a prefix to a name, evaluates the expression, and verifies the deployment output.
Explore string interpolation in a hands-on lab by combining a prefix with the unique string function output and adding a postfix dev in a progressively larger challenge.
See how to build a 24-character string with string interpolation in PowerShell by embedding a unique string with dev using the dollar curly brace syntax, and validate the deployment output.
Explore a lab solution that demonstrates using a resource group function to generate a unique storage account ID, perform deployment, verify results, and explain subscription-based ID differences.
What are variables
When to use variables
Explain storage account name and prefix constraints, validate prefix length in a Bicep deployment, and demonstrate deploying and testing with PowerShell to verify character limits and resulting Azure portal updates.
What is an if/else statement and how can we use this in Bicep
Learn to use if-else in a bicep template by defining an environment parameter and conditionally setting the storage account sku for prod or dev, with outputs.
We will discuss what an array is
The list of allowed values can be handy, with specifying which parameters we need
This demo uses the allowed array for the environmentType parameter to restrict values to prod or dev with a values array and placeholder.
What outputs are and why we use them
A bit more about objects
Learn how to use outputs in a Bicep template to access a storage account object's properties with the dot operator and export the storage account name.
Explore how a sku is represented as an object with properties like name, and how nested objects such as extended location with name and type edge zone are used.
Learn to pass a parameter as an object in Bicep by creating a parameter object with named properties and matching keys to avoid errors.
In this demo, learn to use an object as a parameter in bicep without changing anything, access properties with dot notation, avoid passing strings, and explore variables for object values.
What are parameter files.
Why do we use them ?
What format is it in ?
What is a loop
Why we can use one
Remembering the array data type
demonstrates creating a Bicep parameter of type array, looping through multiple storage account names, and handling array input, overrides, and file parameters.
No file here, since there will be a lot of small labs
Create and loop over an array parameter using a for loop with range to generate multiple storage accounts, starting the index at zero and concatenating strings.
Explore a practical demo lab on creating a parameter of data type array and looping in Bicep, using range, indexing, and the length function to iterate storage accounts.
We will look at arrays and objects
Also how these work together
Learn to output an array of storage account names in a beginner-friendly Bicep lab, using a straightforward loop and simple syntax.
Learn how to output an array in a lab solution by storing names as strings, using zero-based indexing, and reviewing why a simple approach may be good but not ideal.
Set up a lab in Bicep that asks for a loop count via a parameter, creates that many storage accounts, and outputs their names.
Parameterize counts in bicep with an integer parameter, min two and max eight, to control storage account creation and drive loops without hardcoding.
Getting back to where we were !
Explore the end of module challenge solution in Bicep by building storage accounts with a for loop, arrays, and parameters, then generate and test a deployment-ready parameter file.
Here we introduce the things we will learn
Explaining what a Web App is.
Also explaining we will deploy a Web App
Finish the bicep file by turning inputs into parameters, set app service plan and web app names with string interpolation and unique string, and deploy using resource group location.
Demonstrates extending the basic bicep file to output the web application's default hostname as a string, exploring properties and properties of properties, and deploying with PowerShell.
Explanation what modules are
Why would we use modules ?
learn to create a bicep module by organizing a modules folder, copying app.bicep, and parameterizing inputs with no defaults, while the main bicep file acts as the module director.
Demonstrates how to wire a module into the main bicep file, define and pass parameters, and deploy an app service with resource group location and app service plan.
Learn the how and why of Infrastructure as code with Bicep, the very easy language by Microsoft to deploy to Azure!
Bicep is a language which is up and coming and learning this language will help you stay ahead in the world of Infrastructure as code and will be of great benefit to anyone wanting to learn how to leverage the power of Infrastructure as code
This course will teach you how to create Bicep files from scratch and work your way up. You will learn important concepts like parameters, variables, data types, objects, using if, arrays, for loops, modules in Bicep and much more and how to apply them in Bicep templates.
You will learn things like :
What is Infrastructure as code ?
What are ARM Templates ?
What JSON Files are (Pronounced Jason but not Jason...) ?
What is Bicep ?
What are Parameters ?
What are data types ?
What are Built-in functions ?
What are Variables ?
How we make decisions with if ?
What are Objects ?
What are Arrays ?
What are Modules ?
We will do a lot of Hands-on in this course. There will be many little exercises and labs. We will also do some end of Module challenges, which will reinforce the concepts.
After this course you will be able to write Bicep templates and deploy them to Azure.