Deploy a Virtual Network and Virtual Machine Using Bicep
Build a real-world Bicep template that deploys a VNet with subnets, NSG rules, a public IP, and a Linux VM with SSH access.

Lab overview
Deploying networking and compute resources is one of the most common tasks in cloud engineering, and Azure Bicep makes it dramatically simpler than writing raw ARM JSON. In this hands-on lab, you will build a complete multi-resource Bicep template from scratch that deploys a Virtual Network with subnets, a Network Security Group with SSH rules, a public IP address, a network interface, and a Linux Virtual Machine.
You will start by defining the networking foundation. You will create a VNet with a subnet and an NSG with an inbound SSH allow rule. Then you will add compute resources including a public IP, a NIC, and a Linux VM with password authentication protected by the @secure() decorator. Finally, you will deploy the entire stack using az deployment group create and verify all resources and their relationships in the Azure Portal.
Objectives
Upon completing this beginner level lab, you will be able to:
- Define a Virtual Network with subnets using Azure Bicep
- Create a Network Security Group with an inbound SSH allow rule
- Deploy a public IP address and a network interface card referencing the VNet and NSG
- Provision a Linux Virtual Machine with password authentication using the
@secure()parameter - Understand implicit resource dependencies via symbolic name references vs explicit
dependsOn - Verify all deployed resources and their relationships in the Azure Portal
Who is this lab for?
This lab is designed for:
- Cloud engineers who want to deploy real-world networking and compute infrastructure using Bicep
- IT professionals looking to build multi-resource templates with proper dependency management
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed — not multiple choice, real-world proficiency.
More labs like this
Deploy a Full Azure Environment Using Bicep Infrastructure as Code
Write modular Bicep templates to deploy a VNet, App Service, SQL Database, and Key Vault, then deploy the full environment using Azure CLI.
Configure Custom DNS Settings for an Azure Virtual Network
Configure custom DNS servers for an Azure VNet, apply DNS settings at the VNet and NIC level, and verify name resolution between virtual machines
Create an Azure Virtual Machine Scale Set
In this lab, you will create a Virtual Machine Scale Set in Azure with a custom scaling rule.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Logging into Azure CLI
- 02
Writing Bicep for VNet Subnet and NSG Rules
1 automated check
- 03
Adding Public IP Network Interface and Linux VM
1 automated check
- 04
Deploying Full Stack and Verifying VM Resources
1 automated check
Skills validated
Not the lab you were looking for?
Browse 150+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.