Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Built-in and Custom Policy Assignments Deployment - Error: Code=; Message=Received unexpected type Newtonsoft.Json.Linq.JObject #258

Closed
1 task done
benhogg opened this issue Dec 2, 2024 · 2 comments
Labels
Area: Bicep Accelerator ⚡ Issues / PR's related to Bicep Accelerator Type: Bug 🪲 Something isn't working

Comments

@benhogg
Copy link

benhogg commented Dec 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Infrastructure as Code Type? (Required)

bicep

PowerShell Module Version (Optional)

No response

Bootstrap Module Version (Optional)

No response

Starter Module? (Required)

bicep - complete

Starter Module Version (Optional)

No response

Input arguments of the ALZ-PowerShell-Module (Optional)

When deploying Built-in and Custom Policy Assignments I'm getting the below error

Deployment passes What-If stage and I have tried redeploying a few times and still the same

VERBOSE:
02:13:16 - Error: Code=; Message=Received unexpected type Newtonsoft.Json.Linq.JObject

Deployment failed with exception, this is likely an intermittent failure so entering retry loop...
Retrying deployment with attempt number 03 after 40 seconds...
Retrying deployment...
VERBOSE: Using Bicep v0.31.92
VERBOSE: Calling Bicep with arguments: build "/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep" --stdout
WARNING: /home/vsts/work/1/s/infra-as-code/bicep/CRML/customerUsageAttribution/cuaIdManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/policyAssignmentManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentResourceGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/exemptions/policyExemptions.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentResourceGroupMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentManagementGroupMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentSubscriptionMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentSubscription.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/CRML/customerUsageAttribution/cuaIdSubscription.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).

Debug Output/Panic Output (Optional)

Expected Behaviour (Required)

Deployed successfully

Actual Behaviour (Required)

Pipeline fails

VERBOSE:
02:13:16 - Error: Code=; Message=Received unexpected type Newtonsoft.Json.Linq.JObject

Deployment failed with exception, this is likely an intermittent failure so entering retry loop...
Retrying deployment with attempt number 03 after 40 seconds...
Retrying deployment...
VERBOSE: Using Bicep v0.31.92
VERBOSE: Calling Bicep with arguments: build "/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep" --stdout
WARNING: /home/vsts/work/1/s/infra-as-code/bicep/CRML/customerUsageAttribution/cuaIdManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/policyAssignmentManagementGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/assignments/alzDefaults/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentResourceGroup.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/policy/exemptions/policyExemptions.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentResourceGroupMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentManagementGroupMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentSubscriptionMany.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/modules/roleAssignments/roleAssignmentSubscription.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).
/home/vsts/work/1/s/infra-as-code/bicep/CRML/customerUsageAttribution/cuaIdSubscription.bicep(1,1) : Info Bicep Linter Configuration: Custom bicepconfig.json file found (/home/vsts/work/1/s/infra-as-code/bicep/bicepconfig.json).

Steps to Reproduce (Optional)

No response

Important Factoids (Optional)

No response

References (Optional)

No response

@benhogg benhogg added Needs: Triage 🔍 Needs triaging by the team Type: Bug 🪲 Something isn't working labels Dec 2, 2024
@jaredfholgate
Copy link
Member

@oZakari or @sebassem is this something you have seen before?

@oZakari
Copy link
Contributor

oZakari commented Dec 3, 2024

Hi @benhogg,

This is a known issue with Azure PowerShell version 13.0.0. For details, please refer to this issue, which includes a link to the Azure PowerShell repository where the product team is actively working on a resolution.

To address module deployment issues in the meantime, check out our wiki. It provides guidance on pinning the Azure PowerShell version to 12.5.0 as a workaround.

Will close this to avoid duplicate threads but if you have additional questions feel free to reach out in the issue within ALZ-Bicep.

@oZakari oZakari closed this as completed Dec 3, 2024
@oZakari oZakari added Area: Bicep Accelerator ⚡ Issues / PR's related to Bicep Accelerator and removed Needs: Triage 🔍 Needs triaging by the team labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Bicep Accelerator ⚡ Issues / PR's related to Bicep Accelerator Type: Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants