Skip to content

Commit

Permalink
feat: spaceID azure sp account
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 committed Oct 16, 2023
1 parent f51b7b9 commit d9e6bb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions octopusdeploy/resource_azure_service_principal_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func resourceAzureServicePrincipalAccountCreate(ctx context.Context, d *schema.R
log.Printf("[INFO] creating Azure service principal account: %#v", account)

client := m.(*client.Client)
createdAccount, err := client.Accounts.Add(account)
createdAccount, err := accounts.Add(client, account)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -48,7 +48,7 @@ func resourceAzureServicePrincipalAccountDelete(ctx context.Context, d *schema.R
log.Printf("[INFO] deleting Azure service principal account (%s)", d.Id())

client := m.(*client.Client)
if err := client.Accounts.DeleteByID(d.Id()); err != nil {
if err := accounts.DeleteByID(client, d.Get("space_id").(string), d.Id()); err != nil {
return diag.FromErr(err)
}

Expand All @@ -62,7 +62,7 @@ func resourceAzureServicePrincipalAccountRead(ctx context.Context, d *schema.Res
log.Printf("[INFO] reading Azure service principal account (%s)", d.Id())

client := m.(*client.Client)
accountResource, err := client.Accounts.GetByID(d.Id())
accountResource, err := accounts.GetByID(client, d.Get("space_id").(string), d.Id())
if err != nil {
return errors.ProcessApiError(ctx, d, err, "Azure service principal account")
}
Expand All @@ -82,7 +82,7 @@ func resourceAzureServicePrincipalAccountUpdate(ctx context.Context, d *schema.R
log.Printf("[INFO] updating Azure service principal account %#v", account)

client := m.(*client.Client)
updatedAccount, err := client.Accounts.Update(account)
updatedAccount, err := accounts.Update(client, account)
if err != nil {
return diag.FromErr(err)
}
Expand Down

0 comments on commit d9e6bb4

Please sign in to comment.