Skip to content

Commit

Permalink
🐛 fix azure.subscription.policy.assignments id
Browse files Browse the repository at this point in the history
Closes #5040

Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
  • Loading branch information
afiune committed Feb 22, 2025
1 parent f89614d commit e2113cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion providers/azure/resources/azure.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion providers/azure/resources/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func initAzureSubscriptionPolicy(runtime *plugin.Runtime, args map[string]*llx.R
return args, nil, nil
}

func (a *mqlAzureSubscriptionPolicyAssignment) id() (string, error) {
return fmt.Sprintf("azure.subscription.policy/%s/%s", a.Scope.Data, a.Id.Data), nil
}

func (a *mqlAzureSubscriptionPolicy) assignments() ([]interface{}, error) {
conn := a.MqlRuntime.Connection.(*connection.AzureConnection)
ctx := context.Background()
Expand All @@ -51,7 +55,6 @@ func (a *mqlAzureSubscriptionPolicy) assignments() ([]interface{}, error) {
}

assignmentData := map[string]*llx.RawData{
"__id": llx.StringData(fmt.Sprintf("azure.subscription.policy/%s/%s", assignment.Properties.Scope, assignment.Properties.DisplayName)),
"id": llx.StringData(assignment.Properties.PolicyDefinitionID),
"name": llx.StringData(assignment.Properties.DisplayName),
"scope": llx.StringData(assignment.Properties.Scope),
Expand Down

0 comments on commit e2113cd

Please sign in to comment.