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

Wait on password replication #117

Merged
merged 4 commits into from
Jul 12, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions azuread/resource_service_principal_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ func resourceServicePrincipalPasswordCreate(d *schema.ResourceData, meta interfa

d.SetId(id.String())

_, err = graph.WaitForReplication(func() (interface{}, error) {
return client.Get(ctx, id.ObjectId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i think this should be:

Suggested change
return client.Get(ctx, id.ObjectId)
return client.ListPasswordCredentials(ctx, id.ObjectId)

as that is how we are checking if the credentials exist?

})
if err != nil {
return fmt.Errorf("Error waiting for Password with ObjectId %q: %+v", id.ObjectId, err)
}

return resourceServicePrincipalPasswordRead(d, meta)
}

Expand Down