Skip to content

Demonstrate Infrastructure-as-Code (IaC) by automating the creation of resource groups, storage accounts, and networking resources with Bicep templates.

Notifications You must be signed in to change notification settings

trainwrecked/azure-admin-series-01-arm-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

azure-admin-series-01-arm-automation

Project Overview

This project demonstrates Infrastructure as Code (IaC) deployment in Azure using Bicep templates a key AZ-104 and real-world cloud admin skill.

It automates the creation of a resource group-level environment containing:

  • A Storage Account
  • A Virtual Network (VNet) with one subnet
  • Resource tagging for governance and cost tracking

Architecture Diagram

Tenant (Entra ID) Subscription: Resource Group: RG-ARM-Automation Storage Account (Standard_LRS) Virtual Network (10.10.0.0/16) Subnet: default (10.10.1.0/24)

Files Overview

File Description
main.bicep Main Bicep template deploying the resources
parameters.json Template parameter values (location, prefix, environment)
deploy.ps1 PowerShell deployment script
deploy.sh Bash (Azure CLI) deployment script
screenshots/ Folder for portal screenshots or CLI output

Deployment Instructions

'main.bicep' | Deploys a resource group-level environment containing a storage account and virtual network

@description('Location where all resources will be deployed') param location string = resourceGroup().location

@description('Prefix for resource names') param prefix string = 'wpitlab'

@description('Environment tag (e.g., Dev, Test, Prod)') param environment string = 'Dev'

// Create Storage Account resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = { name: '${prefix}st${uniqueString(resourceGroup().id)}' location: location sku: { name: 'Standard_LRS' } kind: 'StorageV2' tags: { Environment: environment Owner: 'AzureAdmin' } }

// Create Virtual Network resource vnet 'Microsoft.Network/virtualNetworks@2023-05-01' = { name: '${prefix}-vnet' location: location properties: { addressSpace: { addressPrefixes: [ '10.10.0.0/16' ] } subnets: [ { name: 'default' properties: { addressPrefix: '10.10.1.0/24' } } ] } tags: { Environment: environment } }

output storageAccountName string = storageAccount.name output vnetName string = vnet.name

'parameters.json' | Template parameter values (location, prefix, environment) |

{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "location": { "value": "eastus" }, "prefix": { "value": "wpitdemo" }, "environment": { "value": "Dev" } } }

'deploy.ps1' | PowerShell deployment script |

deploy.ps1

PowerShell deployment script for Azure Bicep template

Variables

$resourceGroupName = "RG-ARM-Automation" $location = "EastUS"

Create Resource Group

New-AzResourceGroup -Name $resourceGroupName -Location $location

Deploy the Bicep template

New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile "main.bicep" ` -TemplateParameterFile "parameters.json"

Output the results

Get-AzResource -ResourceGroupName $resourceGroupName | Select Name, ResourceType, Location

'deploy.sh' | Bash (Azure CLI) deployment script |

#!/bin/bash

deploy.sh

Azure CLI deployment script for Bicep template

RESOURCE_GROUP="RG-ARM-Automation" LOCATION="eastus"

Create Resource Group

az group create --name $RESOURCE_GROUP --location $LOCATION

Deploy Bicep Template

az deployment group create
--name "ARMDeployDemo"
--resource-group $RESOURCE_GROUP
--template-file main.bicep
--parameters @parameters.json

List deployed resources

az resource list --resource-group $RESOURCE_GROUP -o table

Deployment Instructions

Option 1: Azure CLI

az login
chmod +x deploy.sh
./deploy.sh

**Option 2: Azure PowerShell**
Connect-AzAccount
.\deploy.ps1

*Cleanup* | When finished, delete all resources with:
az group delete --name RG-ARM-Automation --yes --no-wait

# Skills Demonstrated
Azure Resource Manager (ARM) architecture

Bicep template authoring

Resource Groups, Storage, and Networking

Azure CLI and PowerShell automation

Resource tagging and governance

About

Demonstrate Infrastructure-as-Code (IaC) by automating the creation of resource groups, storage accounts, and networking resources with Bicep templates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published