DEV Community

Cover image for Infrastructure as Code: Modular Multi-Resource Azure Deployment with ARM Templates & CLI
Kolarinde Awopetutimileyin
Kolarinde Awopetutimileyin

Posted on

Infrastructure as Code: Modular Multi-Resource Azure Deployment with ARM Templates & CLI

Project Overview

This project documents a modular Azure deployment pipeline built entirely through the Azure CLI and ARM (Azure Resource Manager) templates in VS Code. Each Azure resource — Key Vault, Storage Account, and Web App — was isolated into its own project folder with dedicated template.json and parameters.json files, deployed into its own resource group. The walkthrough also captures genuine debugging moments: resolving a missing-file path error and repeated DNS/connectivity failures against management.azure.com, both handled through methodical retries rather than guesswork.

Skills demonstrated: ARM template authoring & parameterization, Azure CLI deployment workflows (az group create, az deployment group create), resource group isolation per workload, working-directory/path troubleshooting, transient network error diagnosis and recovery, modular Infrastructure-as-Code project structure.

Screen-by-Screen Breakdown
Screen 1 — Verifying Azure Session & Provisioning the Key Vault Resource Group


Confirmed the active Azure CLI session and subscription context before provisioning, then worked through a transient DNS resolution failure on a listing command to successfully create a dedicated resource group for the Key Vault module.

Steps:

Open the integrated PowerShell terminal in VS Code.
Run az account list to confirm the active subscription, tenant, and signed-in user.
Run az group list to check existing resource groups (encountered a transient getaddrinfo failed DNS error against management.azure.com).
Run az group create -n key-rg -l westus3 to provision a new resource group scoped to the Key Vault deployment.
Confirm success via the returned JSON ("provisioningState": "Succeeded").

Screen 2 — Deploying the Key Vault ARM Template


Deployed a parameterized ARM template into key-rg, first resolving a working-directory mismatch, then supplying required parameters interactively and retrying past a transient connectivity error until the Key Vault deployment completed.

Steps:

Attempt az deployment group create --resource-group key-rg --template-file template.json from the ARM-Templates root — fails (No such file or directory: 'template.json').
Run cd keyvault to move into the correct template directory.
Re-run the deployment command; the CLI interactively prompts for required parameters (vaultName, keyName).
Supply parameter values (e.g. nazarethvault, nazarethkey).
Retry after a transient DNS/connection error.
Confirm the successful deployment output, showing the dependency on Microsoft.KeyVault/vaults/nazarethvault.

Screen 3 — Provisioning and Deploying the Storage Module


Created a second, isolated resource group for the storage workload, pushed through repeated transient Azure Resource Manager connectivity errors, and deployed the storage ARM template from its own dedicated directory.

Steps:

Run az group create -n storageRG -l "westus3" — retried after two consecutive DNS resolution failures.
Confirm resource group creation ("provisioningState": "Succeeded").
Navigate out of the previous module and into the storage template folder: cd .. then cd storage-lab.
Run az deployment group create --resource-group storageRG --template-file storage.json.
Retry through further transient connection errors until the deployment succeeds.
Confirm the deployment output (deployment name: storage).

Screen 4 — Modular Project Structure & Web App Parameters


Organized the full IaC project into clean, per-resource folders and configured the Web App module's parameters file ahead of deployment, keeping each resource's template and parameter definitions self-contained.

Steps:

Structure the root ARM-Templates project into isolated subfolders: keyvault, storage-lab, webapp.
Open webapp/parameters.json.
Define parameter values, including webAppName (e.g. ChlarityApp43564) and appServicePlanName.
Review the terminal history confirming the prior successful Key Vault and Storage deployments.
Proceed to deploy the Web App module using the same az deployment group create --resource-group --template-file template.json` pattern.

Top comments (0)