From cce07103f3d40c160d5f802eb36efb9daee111e6 Mon Sep 17 00:00:00 2001 From: henglu Date: Tue, 15 Mar 2022 10:35:32 +0800 Subject: [PATCH 1/4] fix import a connected synapse workspace --- internal/services/synapse/synapse_workspace_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/synapse/synapse_workspace_resource.go b/internal/services/synapse/synapse_workspace_resource.go index 4d614ac93570..bb75d1cc509d 100644 --- a/internal/services/synapse/synapse_workspace_resource.go +++ b/internal/services/synapse/synapse_workspace_resource.go @@ -477,13 +477,13 @@ func resourceSynapseWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) e aadAdmin, err := aadAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { - if !utils.ResponseWasNotFound(aadAdmin.Response) { + if !utils.ResponseWasNotFound(aadAdmin.Response) && !utils.ResponseWasConflict(aadAdmin.Response) { return fmt.Errorf("retrieving AzureAD Admin for %s: %+v", *id, err) } } sqlAdmin, err := sqlAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { - if !utils.ResponseWasNotFound(sqlAdmin.Response) { + if !utils.ResponseWasNotFound(sqlAdmin.Response) && !utils.ResponseWasConflict(sqlAdmin.Response) { return fmt.Errorf("retrieving Sql Admin for %s: %+v", *id, err) } } From 7eaa2a32be4a21a5cbdcfe48fcc8c0d4afb34807 Mon Sep 17 00:00:00 2001 From: henglu Date: Wed, 16 Mar 2022 09:27:29 +0800 Subject: [PATCH 2/4] add comment --- internal/services/synapse/synapse_workspace_resource.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/services/synapse/synapse_workspace_resource.go b/internal/services/synapse/synapse_workspace_resource.go index bb75d1cc509d..51b1fab2dbf6 100644 --- a/internal/services/synapse/synapse_workspace_resource.go +++ b/internal/services/synapse/synapse_workspace_resource.go @@ -477,12 +477,14 @@ func resourceSynapseWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) e aadAdmin, err := aadAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { + // AAD admin is not supported in a synapse workspace created from a Dedicated SQL pool (formerly SQL DW) if !utils.ResponseWasNotFound(aadAdmin.Response) && !utils.ResponseWasConflict(aadAdmin.Response) { return fmt.Errorf("retrieving AzureAD Admin for %s: %+v", *id, err) } } sqlAdmin, err := sqlAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { + // Sql AAD admin is not supported in a synapse workspace created from a Dedicated SQL pool (formerly SQL DW) if !utils.ResponseWasNotFound(sqlAdmin.Response) && !utils.ResponseWasConflict(sqlAdmin.Response) { return fmt.Errorf("retrieving Sql Admin for %s: %+v", *id, err) } From 963b789c24cd27d1673dfc0bb8e69d74fb5520d5 Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Tue, 22 Mar 2022 11:08:13 +0100 Subject: [PATCH 3/4] Update internal/services/synapse/synapse_workspace_resource.go --- internal/services/synapse/synapse_workspace_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/synapse/synapse_workspace_resource.go b/internal/services/synapse/synapse_workspace_resource.go index 51b1fab2dbf6..aa434e55cce4 100644 --- a/internal/services/synapse/synapse_workspace_resource.go +++ b/internal/services/synapse/synapse_workspace_resource.go @@ -484,7 +484,7 @@ func resourceSynapseWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) e } sqlAdmin, err := sqlAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { - // Sql AAD admin is not supported in a synapse workspace created from a Dedicated SQL pool (formerly SQL DW) + // NOTE: SQL Admin isn't supported for a Workspace created from a Dedicated SQL Pool / SQL DataWarehouse and returns a Conflict if !utils.ResponseWasNotFound(sqlAdmin.Response) && !utils.ResponseWasConflict(sqlAdmin.Response) { return fmt.Errorf("retrieving Sql Admin for %s: %+v", *id, err) } From 6fba699da93c9c649e94fbb7eaf16df21134036a Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Tue, 22 Mar 2022 11:08:18 +0100 Subject: [PATCH 4/4] Update internal/services/synapse/synapse_workspace_resource.go --- internal/services/synapse/synapse_workspace_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/synapse/synapse_workspace_resource.go b/internal/services/synapse/synapse_workspace_resource.go index aa434e55cce4..dd5227cb077c 100644 --- a/internal/services/synapse/synapse_workspace_resource.go +++ b/internal/services/synapse/synapse_workspace_resource.go @@ -477,7 +477,7 @@ func resourceSynapseWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) e aadAdmin, err := aadAdminClient.Get(ctx, id.ResourceGroup, id.Name) if err != nil { - // AAD admin is not supported in a synapse workspace created from a Dedicated SQL pool (formerly SQL DW) + // NOTE: AAD Admin isn't supported for a Workspace created from a Dedicated SQL Pool / SQL DataWarehouse and returns a Conflict if !utils.ResponseWasNotFound(aadAdmin.Response) && !utils.ResponseWasConflict(aadAdmin.Response) { return fmt.Errorf("retrieving AzureAD Admin for %s: %+v", *id, err) }