
When deploying resources to Azure, developers often need to manage a variety of resource types, such as virtual machines, storage accounts, and networks. Bicep, a domain-specific language for deploying Azure resources, simplifies this process by providing a declarative syntax that abstracts away the complexities of Azure Resource Manager (ARM) templates. In this article, we’ll explore what Bicep resources are and how to use them effectively.
This is a new series of articles about ‘BiCep’ technology by Microsoft – it is a game changer for resource management in the cloud – well worth investigating if you are a cloud builder!
Understanding Bicep Resources
In Bicep, a resource is a unit of deployment that represents a single Azure resource, such as a virtual machine or a storage account. Resources are defined using the resource keyword, followed by the resource type and name. Here’s a basic example of defining a resource in Bicep:

In this example, myStorageAccount is the name of the resource, Microsoft.Storage/storageAccounts@2021-06-01 is the resource type, and the object following the = sign contains the properties of the resource.
Using Bicep Resources
Declaration
The declaration of a resource in Bicep includes the resource type, name, and properties. Here’s an example of declaring a virtual network resource:

In this example, virtualNetwork is the name of the resource, Microsoft.Network/virtualNetworks@2021-02-01 is the resource type, and the properties object contains the address space of the virtual network.
Resource Name
The resource name is specified as the first argument in the resource declaration. It provides a unique identifier for the resource within the Bicep file.
Location
The location property specifies the Azure region where the resource will be deployed. It ensures that the resource is deployed to a specific geographic location.
Tags
Tags are key-value pairs that can be used to categorize resources in Azure. They can be used for organizing deployed resources, cost management, and other purposes.
Managed Identities for Azure Resources
Managed identities for Azure resources provide an identity for applications to use when accessing Azure resources. You can enable managed identities for a resource using the identity property.
Example

In this example, myAKSCluster is the name of the resource, eastus is the location, and { environment: ‘dev’ } are the tags. The identity is set to SystemAssigned.
Resource-Specific Properties
Resource-specific properties vary depending on the type of resource being deployed. For example, a virtual machine resource may have properties related to its size, operating system image, and networking configuration. These properties are specified within the properties object of the resource declaration.






Join the conversation! Your thoughts help the community grow.