Create first file in Azure Bicep

Everton Araújo
2 min readDec 28, 2022

--

Azure Bicep logo

Today it will be a simple file and I will do a series explaining its differences with other infrastructure tools as code.First of all let’s combine some prerequisites:

- Azure account
- Azure-CLI
- VsCode

Install plugins in extensions on VsCode:
- Azure Account
- Bicep
- Align Bicep

Please leave the Azure Account logged in.

We will create the main.bicep file

A very simple example will be created here and today a VNET called EPMA will be created. Today’s intention is to do something simple and nothing complex and just see the file work.

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019–11–01' = {
name: 'epma'
location: resourceGroup().location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: 'Subnet-1'
properties: {
addressPrefix: '10.0.0.0/24'
}
}
{
name: 'Subnet-2'
properties: {
addressPrefix: '10.0.1.0/24'
}
}
]
}
}
Click — Deploy Bicep File — main.bicep

After deploying the main.bicep file and it will ask for a param : select none and then in VsCode you will have to indicate a ResourceGroup and in this case I will indicate the rg : everton.cloud

Select region (us-east-1) and param (skip)

Last line — Deployment succedded

Destroy bicep vnet — type in your terminal

az group delete --name everton.cloud                                                               3m 10s az Azure for Students 01:45:32

To shred a bicep file takes approximately 2–5 minutes on average in my experience.

Source: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview

--

--

Everton Araújo
Everton Araújo

No responses yet