bicep how do i consume public avm modules

In this example, we will be using Azure verified module to create a storage account. So first we need 


module cheapStorage 'br/public:avm/res/storage/storage-account:0.31.2' = {
  name: 'storageDeployment'
  params: {
    // Required: Must be 3-24 lowercase letters/numbers and globally unique
    name: 'stg${uniqueString(resourceGroup().id)}'
    location: resourceGroup().location
   
    skuName: 'Standard_LRS'
    kind: 'StorageV2'
    accessTier: 'Hot' // 'Hot' is better if you'll actually look at the files; 'Cool' is cheaper for long-term storage
   
    allowBlobPublicAccess: false
    networkAcls: {
      defaultAction: 'Allow'
      bypass: 'AzureServices'
    }
  }
}

// Output the primary endpoint so you can actually find your new toy
output storageUri string = cheapStorage.outputs.primaryBlobEndpoint

And then we can run the following command to deploy it 


az stack group create --name "my-public-avm"
--resource-group "MyDevRG"   --template-file ./main.bicep
--deny-settings-mode "none" --action-on-unmanage "detachAll"

For info about the modules can be found here

https://github.com/Azure/bicep-registry-modules/releases/tag/avm%2Fres%2Fstorage%2Fstorage-account%2F0.31.2 



Comments

Popular posts from this blog

vllm : Failed to infer device type

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

android studio kotlin source is null error