Azure / ALZ-Bicep

This repository contains the Azure Landing Zones (ALZ) Bicep modules that help deliver and deploy the Azure Landing Zone conceptual architecture in a modular approach. https://aka.ms/alz/docs
MIT License
764 stars 514 forks source link

Can't deploy Azure policy alzDefaultPolicyAssignments.bicep in latest commit c375e41 module with powershell #884

Closed KeysAU closed 1 month ago

KeysAU commented 1 month ago

What happened? Provide a clear and concise description of the bug, including deployment details.

When trying to deploy step 8 ,via PowerShell, it gets stuck and never loads the template file. This works on a much older version. "version": "0.17.2". (I was upgrading to latest )

# For Azure global regions

$inputObject = @{
  DeploymentName        = -join ('alz-alzPolicyAssignmentDefaultsDeployment-{0}' -f (Get-Date -Format 'yyyyMMddTHHMMssffffZ'))[0..63]
  Location              = 'eastus'
  ManagementGroupId     = 'alz'
  TemplateFile          = "infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep"
  TemplateParameterFile = 'infra-as-code/bicep/modules/policy/assignments/alzDefaults/parameters/alzDefaultPolicyAssignments.parameters.all.json'
}

New-AzManagementGroupDeployment @inputObject

Stuck, gave it a good 30min. Image

Please provide the correlation id associated with your error or bug.

No error never loads template file. Its like it is stuck.

What was the expected outcome?

It to deploy azure policy defaults

Relevant log output

NA

Check previous GitHub issues

Code of Conduct

KeysAU commented 1 month ago

So if anyone else gets this issue I figured it out. It's too long a path for powershell to load the policies.

I was running from C:\users\myusername\Repos\blah\blah\blah

Move the whole alz-bicep repo to C:\