Skip to content

Commit

Permalink
🐛 fix azure.subscription.policy.assignments id (#5253)
Browse files Browse the repository at this point in the history
  • Loading branch information
afiune authored Feb 22, 2025
1 parent f89614d commit 497afaa
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 497afaa

Please sign in to comment.