Skip to content

Modules need versions #1242

@ChristopherGLewis

Description

@ChristopherGLewis

Is your feature request related to a problem? Please describe.
As I've progressed in my first real-world Bicep deploy I've hit a point where it would be extremely helpful to have a module version.

While I'm able to maintain this through my code repo and in general just rewriting how my modules are used, I can see that some of my rewrites would be solved with a module version field.

I've got a repo set up like this:

\ Root
   +- Network
       +- modules
   +- VM
       +- modules

Both Network and VM ended up with a pip.bicep module. Network's pip was for Azure Bastion, and the VM's was for its NIC.

Initially, the PIP with the VM looked like this:

param pipName string
param pipSKU string {
   default: 'Basic'
   allowed: [
     'Basic'
     'Standard'
   ]
}

resource publicIp 'Microsoft.Network/publicIPAddresses@2020-06-01' = {
  name: pipName
  location: resourceGroup().location
  sku: {
     name: pipSKU
  }
  properties: {
    publicIPAllocationMethod: 'Dynamic'
  }
}

output id string = publicIp.id

Later, the Network pip required a passed in allocation method

param pipName string
param pipSKU string {
   default: 'Basic'
   allowed: [
     'Basic'
     'Standard'
   ]
}
param pipAllocationMethod string {
   default: 'Dynamic'
   allowed: [
     'Dynamic'
     'Static'
   ]
}
resource publicIp 'Microsoft.Network/publicIPAddresses@2020-06-01' = {
  name: pipName
  location: resourceGroup().location
  sku: {
     name: pipSKU

  }
  properties: {
    publicIPAllocationMethod: pipAllocationMethod
    //dnsSettings: {
    //  domainNameLabel: dnsLabelPrefix
    //}
  }
}

output id string = publicIp.id

Since these are in separate folders, not a problem. But I'm wanting to move towards a structure like this:

\ Root
   +- modules
   +- Network
   +- VM

with shared modules.

I can force this by naming my modules with a version (pip@1.0.bicep vs pip@1.1.bicep) but then I'd like bicep to also work with just pip.bicep or pip@latest.bicep. This might put a lot more pressure on Bicep to figure out versioning ( date vs semantic - is @2020.12.30 newer than @1.0 ?)

I did some reading of issue #58 and can see where this discussion went on implementing later, but I'd like to enter this for better tracking.

Describe the solution you'd like
I'd like to see a thought-out plan for this, that includes local repos, local shared libraries, the whole "Bicep Module Registry" and how modules look in an Azure object library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions