Skip to main content

Command Palette

Search for a command to run...

ClickOps to Code: Recreating Azure Virtual Networks with ARM Templates (No CLI Required).

Updated
3 min read
ClickOps to Code: Recreating Azure Virtual Networks with ARM Templates (No CLI Required).
I

I'm Iniobong Ema, a Cloud and DevOps Engineer, I'm passionate about automation, pipelines and building scalable systems. I document my journey, share tutorials and explore modern tech solutions-one experiment at a time. From Code to Cloud: My DevOps Journey. My contact information: Phone number: 08027604029 Gmail Address: iniema2025@gmail.com, iniakan4real2017@gmail.com

Infrastructure doesn’t have to start with command lines. Many Azure engineers begin in the portal—and that’s perfectly fine. The real upgrade is learning how to capture what you built, turn it into code, and redeploy it consistently.

In this step-by-step technical blog, you’ll learn how to deploy an Azure Virtual Network (VNet) using an ARM template entirely from the Azure Portal, export the template, and redeploy it—without using Azure CLI at any point.

Why ARM Templates for VNets?

A Virtual Network is the foundation of almost every Azure workload. When you manage VNets manually: Configurations can drift, Recreating environments is slow, Mistakes happen, ARM templates solve this by making your network:

  1. Repeatable

  2. Version-controlled

  3. Consistent across environments


We’ll deploy a custom template

  • Deployment method: Azure Portal only and VScode

Prerequisites

  • An active Azure subscription

  • Access to the Azure Portal

  • Basic knowledge of networking concepts

Step 1: Deploy a Linux VNet via Azure Portal

Although ARM templates are often authored manually, exporting an existing deployment is a practical way to understand resource structure.

Create the VNet

  1. Sign in to the Azure Portal, type deploy on azure search bar, select ‘Deploy a custom template’

    On the ‘deploy a custom template’ page, select ‘Build your own template in the editor’

    The page below will be displayed, delete the highlighted section

    Copy the code from no 4 (https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/quickstart-create-templates-use-the-portal), to the azure portal and paste.

    Click on ‘Save’

    The page below will be displayed. create a resource group, allow others at default, then review and create

    After clicking on ‘review and create’ after validation is successful, then click on ‘create’

    After a successful deployment, click on ‘Go to resource’

    On the overview page, click on the arm-rg to ensure the VNET1 was actually created

    To see the subnet that was created, on the left pane, click on settings then subnets

    On the subnet page, you will see the subnet that was created

    You can use automation option on the left bar to export or redeploy template, ARM template etc.

    On the menu, click on download, open downloaded files in your computer, use VScode

    Step 2: Redeploy the VNet Using the ARM Template

    To redeploy using this template, lets delete the existing vnet1 and redeploy

    Go to ‘Deploy custom template’ on azure portal

    The page below will be displayed, click on ‘build your own template in the editor’

    On the displayed page, delete the displayed code and click on ‘Load file’

    Go to your download folder, click the downloaded template, click on open. The file will be displayed as shown

    Click on ‘save’. On the displayed page, create a new RG, allow others at default, then click on ‘Review and Create’

    Then ‘create’

    After a successful deployment, click on ‘Go to Resource

    On the new vnet created in the new-arm-rg, you can see the NNet 1.

    Final step: Validate the Redeployed VNet

    1. Navigate to Virtual networks

    2. Confirm the new VNet exists

    3. Check subnets and address ranges

    Everything matches the original, our redeployment was successful.


    Conclusion

    We’ve just completed a full Infrastructure-as-Code workflow without Azure CLI:

1. Deployed a VNet using an ARM template
2. Exported the deployed infrastructure
3. Redeployed it consistently using the Azure Portal