Azure / AKS-Construction

Accelerate your onboarding to AKS with; Helper Web App, bicep templating and CI/CD samples. Flexible & secure AKS baseline implementations in a Microsoft + community maintained reference implementation.
https://azure.github.io/AKS-Construction/
MIT License
356 stars 165 forks source link

AKS-construction as bicep module support #671

Closed SzymonSt closed 10 months ago

SzymonSt commented 11 months ago

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

SzymonSt commented 10 months ago

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

SzymonSt commented 10 months ago

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.