my simple bicep setup that uses module

 

main.bicep 

targetScope='subscription'

resource newRG 'Microsoft.Resources/resourceGroups@2021-01-01' = {
  name: 'bicep-test-rg'
  location: 'australiaeast'
}

module datastore 'sa.bicep' = {
   name: 'storedeployment'
   scope: newRG
   params: {
     location: newRG.location
     name: 'mydevdatastore'
     storageAccountType: 'Standard_LRS'
   }
}


sa.bicep (storage account bicep) 

@allowed([
  'Premium_LRS'
  'Premium_ZRS'
  'Standard_GRS'
  'Standard_GZRS'
  'Standard_LRS'
  'Standard_RAGRS'
  'Standard_RAGZRS'
  'Standard_ZRS'
])
@description('Storage account type.')
param storageAccountType string = 'Standard_LRS'

@description('Location for all resources.')
param location string = resourceGroup().location
param name string = 'mydevstore'

resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
  name: name
  location: location
  sku: {
    name: storageAccountType
  }
  kind: 'StorageV2'
  properties: {}
  tags: {
    squad: 'mydevelopers'
    tribe: 'apollo'
  }
}

output storageAccountNameOutput string = storageAccount.name









Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm