Search code examples
powershelldatabricksazure-databricks

Error 403 when trying to export a Databricks Workspace


I'm facing an issue when trying to export to local path. This is the code (after connecting to Azure with my account)


Export-DatabricksWorkspaceItem -Path $ExportPath -LocalPath $LocalPath -Format DBC

And this is the error I get

Error 403 Invalid access token.  HTTP ERROR 403 Problem accessing /api/2.0/workspace/export. Reason:     Invalid access token.

I tried using Get-DatabricksWorkspaceItem to list it but I'm facing the same error. I'm using PowerShell 7.2.9. Tried to pass -apiKey or a -Tokencreated in Databricks with my account but those parameters do not exist.


Solution

  • It seems DatabricksPS module is not working in PowerShell 7.X.X. Instead, I've found other module called PSAzureDatabricks that have the method Export-AzureDatabricksContent.

    If someone is strugling with this, here is the documentation link