Complete the code to declare a resource group in Bicep.
resource myResourceGroup '[1]' = { name: 'myResourceGroup' }
The resource type for a resource group in Bicep is Microsoft.Resources/resourceGroups@2021-04-01. This defines the resource group itself.
Complete the code to declare a storage account resource in Bicep.
resource storageAccount '[1]' = { name: 'mystorageaccount', location: 'westus', sku: { name: 'Standard_LRS' }, kind: 'StorageV2' }
The correct resource type for a storage account in Bicep is Microsoft.Storage/storageAccounts@2021-06-01. This defines the storage account resource.
Fix the error in the Bicep code by completing the resource type for a virtual machine.
resource vm '[1]' = { name: 'myVM', location: 'centralus', properties: {} }
The resource type for a virtual machine in Bicep is Microsoft.Compute/virtualMachines@2022-01-01. This is required to correctly deploy a VM.
Fill both blanks to declare a virtual network with an address prefix and a subnet.
resource vnet '[1]' = { name: 'myVnet', location: 'eastus2', properties: { addressSpace: { addressPrefixes: [ '[2]' ] }, subnets: [ { name: 'default', properties: { addressPrefix: '10.0.0.0/24' } } ] } }
The resource type for a virtual network is Microsoft.Network/virtualNetworks@2021-05-01. The address prefix for the network is typically a larger range like 10.0.0.0/16 to include subnets.
Fill all three blanks to create a storage account with a SKU, kind, and access tier.
resource storage '[1]' = { name: 'storageacct', location: 'westus2', sku: { name: '[2]' }, kind: '[3]', properties: { accessTier: 'Hot' } }
The storage account resource type is Microsoft.Storage/storageAccounts@2021-06-01. The SKU name Standard_LRS defines the replication type. The kind StorageV2 is the general-purpose v2 storage account.