How To Automate Your Baseline Network In Azure

Azure resources are represented by ARM templates, which are files. You create them in a unique JSON format that goes beyond plain JSON.

Bicep is a domain-specific language, With Azure Bicep, Microsoft hopes to improve the authoring experience with more flexible file structures, improved code reuse, and easier terminology.

When comparing ARM and BICEP syntax, ARM syntax is more complex than BICEP, and its line density is also much lower.BICEP has a fairly simple syntax.

SPECIFICATIONS:

Create Resource group:

Login into the Azure portal

Fill requirements per needs:

Name: RG-DEMO1 Location: WESTUS3

Create:

Now on Visual Studio code:

Save the file: sample.json

Create ARM Template:

Give the particulars as per requirements

Name: dempvnet123

Location: Westus3

Subnet1 & Address prefix-10.0.0.0/24

Subnet2 & Address prefix – 10.0.1.0/24

Now Deploy :

"az deployment group create --resource-group RG-DEMO1 --template-file sample.json"

Now you can find:

ProvisioningState is “succeeded”.

Open the Azure portal to confirm:

Under Resource Group- dempvnet123(virtual network)

Open Vnet & Refresh it:

Under Subnets - You can find the subnets: subnets1 & subnet2

Create VNet by using BICEP:

Create one Resource Group -

name: bicepquickstart-rg

location: westus

Create BICEP file and give the particulars

Name: jmkvnet1

Location: westus

Subnet names: bicepsubnet1 & Address prefix 10.0.0.0/24

&

bicep subnet2 & Address prefix 10.0.1.0/24

Deploy it now:

“az deployment group create --resource-group 'bicepquickstart-rg' --template-file '123.bicep”

ProvisioningState: “succeeded”

Confirm on Azure – open the Azure portal and check the name virtual network- jmkvent1 under bicepquickstart-rg -Resourcegroup

Open jmkvnet – you can find 2 subnets:

1.bicepsubnet1

2.bicepsubnet2

Conclusion: By Using ARM & BICEP we can create any service under a particular Resource group like App services, app plan, Vnet, Storage etc.

Thank you!

Hope this was helpful to you.