@@ -30,6 +30,7 @@ locals {
3030 deploymentType = script_file.deploymentType
3131 firstRunWhatIf = local.is_classic_bicep ? format (" %s%s" , " $" , script_file. firstRunWhatIf ) : null
3232 group = script_file.group
33+ networkType = try (script_file. networkType , " " )
3334 } if ! local . is_classic_bicep || try (script_file. networkType , " " ) == " " || try (script_file. networkType , " " ) == local . networking_type } : {}
3435
3536 deploy_script_files_parsed = { for deploy_script_file in local . deploy_script_files : " ${ local . target_folder_name } /${ deploy_script_file } " =>
@@ -63,8 +64,27 @@ locals {
6364 } if local . is_bicep_iac_type ? true : ! endswith (key, " .ps1" )
6465 }
6566
67+ # Replace subscription ID placeholders in .bicepparam files
68+ module_files_with_subscriptions = { for key , value in local . module_files : key =>
69+ {
70+ content = endswith (key, " .bicepparam" ) ? replace (
71+ replace (
72+ replace (
73+ value. content ,
74+ " {{your-management-subscription-id}}" ,
75+ try (var. subscription_ids [" management" ], var. subscription_id_management , " " )
76+ ),
77+ " {{your-connectivity-subscription-id}}" ,
78+ try (var. subscription_ids [" connectivity" ], var. subscription_id_connectivity , " " )
79+ ),
80+ " {{your-identity-subscription-id}}" ,
81+ try (var. subscription_ids [" identity" ], var. subscription_id_identity , " " )
82+ ) : value.content
83+ }
84+ }
85+
6686 # Build a map of module files with types that are supported
67- module_files_supported = { for key , value in local . module_files : key => value if value . content != " unsupported_file_type" && ! endswith (key, " -cache.json" ) && ! endswith (key, local. bicep_config_file_path ) }
87+ module_files_supported = { for key , value in local . module_files_with_subscriptions : key => value if value . content != " unsupported_file_type" && ! endswith (key, " -cache.json" ) && ! endswith (key, local. bicep_config_file_path ) }
6888
6989 # Build a list of files to exclude from the repository based on the on-demand folders (only for classic bicep)
7090 excluded_module_files = local. is_classic_bicep ? distinct (flatten ([for exclusion in local . on_demand_folders :
0 commit comments