Azure/AKS-Construction

AKS-construction as bicep module support

SzymonSt opened this issue · 2 comments

Describe the bug
I've figured I could use aks-construction as bicep module itself by pulling tag(0.10.3) for specific release is this approach somehow supported?
I've tried making it work but I keep getting error:

Deployment template validation failed: 'The template resource 'Microsoft.ContainerService/managedClusters/aks-lab-mnc01-***-a99' cannot reference itself. Please see https://aka.ms/arm-function-reference for usage details.

To Reproduce
Steps to reproduce the behavior:

  1. Create .bicep file.
  2. Reference AKS-Construction/bicep/main.bicep as module pulled locally and provide minimal parameters.
  3. Create bicep deployment

Bicep version:
Bicep CLI version 0.22.6 (d62b94db31)

Expected behavior
Minimal AKS cluster will be created

Screenshots
image

I've checked docs and according to: https://github.com/Azure/AKS-Construction/blob/main/docs/AdvancedUsage.md It should be possible but it doesn't work for me I pull it from tag 0.10.3

I discovered that this happens only if I define scope for example : scope: resourceGroup(anyResourceGroup) while using aksConstruction as module. I will try to figure out if this is a bug, help will be most welcome though.