Azure / ALZ-PowerShell-Module

The Azure Landing Zones Accelerators PowerShell module
https://www.powershellgallery.com/packages/ALZ/
MIT License
72 stars 36 forks source link

Prefix in Bicep starter module should have a different default value #126

Closed juyamagu closed 3 months ago

juyamagu commented 3 months ago

As the default value of Prefix in Bicep starter module (described in [User Guide] Starter Module Bicep Complete) is problematic, deploying starter modules with Bicep failed.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce

Try to deploy a starter module with Bicep just by following the step 1 to 3, using the default setting (i.e. landing-zone for Prefix) showed in the doc and examples.

Context (Environment)

Detailed Description

This parameter in Bicep starter module will eventually be passed into parTopLevelManagementGroupPrefix in managementGroupsScopeEscape.bicep, which requires its length to be up to 10. However, its current default value is landing-zone and doesn't comply with the limit, resulting in an error when deploying the starter module.

Here's an example in case of using GitHub Action, showing the action stuck in the step What If: Management Groups Deployment keep outputting the following error:

/actions-runner/_work/alz-mgmt/alz-mgmt/infra-as-code/bicep/CRML/customerUsageAttribution/cuaIdManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/actions-runner/_work/alz-mgmt/alz-mgmt/infra-as-code/bicep/bicepconfig.json).

Getting the latest status of all resources...

InvalidTemplate - Long running operation failed with status 'Failed'. Additional Info:'Deployment template validation failed: 'The provided value for the template parameter 'parTopLevelManagementGroupPrefix' is not valid. Length of the value should be less than or equal to '10'. Please see https://aka.ms/arm-syntax-parameters for usage details.'.'
Deployment failed with exception, this is likely an intermittent failure so entering retry loop...
Retrying deployment with attempt number 15 after 160 seconds...
oZakari commented 3 months ago

Ran into the same error, will open PR to fix this now. Thanks @juyamagu!