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

Issue with StarterKit Files #116

Closed
martyh888 opened this issue Jan 22, 2023 · 6 comments
Closed

Issue with StarterKit Files #116

martyh888 opened this issue Jan 22, 2023 · 6 comments

Comments

@martyh888
Copy link

Issues with StarterKit files where name of definition has spaces

policyDefinitions/Defender/azure-defender-enroll.json

This following throws the error due to spaces and not using "-" instead

New-AzPolicyDefinition: /home/vsts/work/1/s/Scripts/Deploy/Deploy-PolicyPlan.ps1:208
Line |
 208 |              $null = New-AzPolicyDefinition @policyDefinition
     |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | MismatchedPolicyDefinitionName : The policy definition name
     | 'EnableAzureDefenderforResourceType' in the request body does not match
     | the policy definition name 'Enable Azure Defender for Resource Type' in
     | the request uri. CorrelationId: f6e0eade-9bfd-4df6-9863-514d6a534d12

Need to fix this

"name": "Enable Azure Defender for Resource Type",

And also fix file Definitions/policySetDefinitions/defender-dine-enable-for-subscription-initiative.jsonc to be the same as what the name is changed to above

@techlake
Copy link
Contributor

techlake commented Jan 22, 2023

This is caused by a bug in Az PowerShell Module 9.2.x. It is fixed in 9.3.0. I will add a big warning to the README.md file tomorrow.
Please update the version on your runner.

@martyh888
Copy link
Author

Will this also fix this issue
image

@martyh888
Copy link
Author

Thanks all good working now with this change in pipeline

Replaced this line in all occurrences in pipeline

azurePowerShellVersion: LatestVersion

with this

preferredAzurePowerShellVersion: "9.3.0"

@techlake
Copy link
Contributor

Great. I'll put that in the README file. Your fix above is a partial fix. The bug in 9.2.x removes all spaces in any of the values. It breaks display names, descriptions, even parameter values in assignments. See Azure/azure-powershell#20407.

@techlake
Copy link
Contributor

Microsoft hosted agents have been upgraded as of today 1/23/2023. The solution is working again correctly.

@techlake
Copy link
Contributor

Actually, some are updated, some are still on 9.2.0. Try again tomorrow when all images should be rolled over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants