How to onboard log analytics workSpace to microsoft sentinel in azure through terraform

Failure responding to request: StatusCode=400 – Original Error: autorest/azure: Service returned an error. Status=400 Code=“BadRequest” Message=“{"error":{"code":"BadRequest","message":"Workspace ‘test’ is not onboarded to Microsoft Sentinel."}}”