Azure / Azure/GuestConfiguration
The order of parameters in /Microsoft.GuestConfiguration/guestConfigurationAssignments properties.parameterHash is unclear if multiple resources defined in DSC configuration
- Dominant language
- PowerShell
- Stars
- 8
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
I will summarize in short for those, who do not know.
The AzureRM resource `/Microsoft.GuestConfiguration/guestConfigurationAssignments ` advertise the property `properties.parameterHash`. In Base 64 format it contains series of [ResourceType]ResourceId;ResourcePreoperty'=ResourceValue.
The `New-GuestConfigurationPolicy` generated Azure Policy definition which internally relies on this parameter. Example:
```
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/complianceStatus",
"equals": "Compliant"
},
{
"field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/parameterHash",
"equals": "[base64(concat('[DSC_HardeningAuditpol]AuditpolInstance;BackupAuditpol', '=', parameters('AuditpolBackupAuditpol'), ',', '[DSC_HardeningAuditpol]AuditpolInstance;HardeningLevel', '=', parameters('AuditpolHardeningLevel'),
```
**The order matters.** Else the Policy will never show the compliance. `New-GuestConfigurationPolicy -Parameter $PolicyParameterInfo` where `$PolicyParameterInfo` should have propper order.
As per my tests:
- if the DSC Configuraiton contains one reosurce, the paramaters in `properties.parameterHash` are in alphabetical order.
- if the DSC Configuraiton contains **multiple reosurce**, the paramaters in `properties.parameterHash` are **loosing order**, at least i cannot identify it.
Has any one came across this issue?
My company requires automated solution to generate Azure Policies and currently this is blocker for me
Contributor guide
Assessment
This issue has not been assessed yet.