diff --git a/internal/services/apimanagement/api_management_backend_resource.go b/internal/services/apimanagement/api_management_backend_resource.go index a990324ed88b..2e1ae7abcd6c 100644 --- a/internal/services/apimanagement/api_management_backend_resource.go +++ b/internal/services/apimanagement/api_management_backend_resource.go @@ -540,17 +540,17 @@ func flattenApiManagementBackendCredentials(input *backend.BackendCredentialsCon if input.Certificate != nil { result["certificate"] = *input.Certificate } - result["header"] = flattenApiManagementBackendCredentialsObject(*input.Header) - result["query"] = flattenApiManagementBackendCredentialsObject(*input.Query) + result["header"] = flattenApiManagementBackendCredentialsObject(input.Header) + result["query"] = flattenApiManagementBackendCredentialsObject(input.Query) return append(results, result) } -func flattenApiManagementBackendCredentialsObject(input map[string][]string) map[string]interface{} { +func flattenApiManagementBackendCredentialsObject(input *map[string][]string) map[string]interface{} { results := make(map[string]interface{}) if input == nil { return results } - for k, v := range input { + for k, v := range *input { results[k] = strings.Join(v, ",") } return results