From d9e6bb4326b2dae77910e7f58ba2f1da854babf0 Mon Sep 17 00:00:00 2001 From: Domenic Simone Date: Tue, 17 Oct 2023 09:36:47 +1100 Subject: [PATCH] feat: spaceID azure sp account --- octopusdeploy/resource_azure_service_principal_account.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/octopusdeploy/resource_azure_service_principal_account.go b/octopusdeploy/resource_azure_service_principal_account.go index b005a0aae..843f2309f 100644 --- a/octopusdeploy/resource_azure_service_principal_account.go +++ b/octopusdeploy/resource_azure_service_principal_account.go @@ -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) } @@ -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) } @@ -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") } @@ -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) }