microsoft / PSRule

Validate infrastructure as code (IaC) and objects using PowerShell rules.
https://microsoft.github.io/PSRule/v2/
MIT License
396 stars 49 forks source link

Rule annotations are null in C# library #1378

Closed BernieWhite closed 1 year ago

BernieWhite commented 1 year ago

Description of the issue

When running PSRule through the C# library, in Record(IResultRecord record) of the HostContext, ruleRecord.Info.Annotations is null even though the rule has annotations defined like this:

{
   "apiVersion":"github.com/microsoft/PSRule/v1",
   "kind":"Rule",
   "metadata":{
      "name":"Azure.Policy.f35b4954cba2",
      "tags":{
         "Azure.Policy/category":"App Service"
      },
      "annotations":{
         "Azure.Policy/id":"/providers/Microsoft.Authorization/policyDefinitions/5bb220d9-2698-4ee4-8404-b9c30c9df609",
         "Azure.Policy/version":"3.0.0"
      }
   },
   "spec":{
      [...]
   }
}

This for the issue Azure/PSRule.Rules.Azure#1949

VeraBE commented 1 year ago

Oh, wow, that was so fast, thank you Bernie!