Forum Discussion
Operation returned an invalid status code 'Unauthorized' while copying data to Lakehouse
ErrorCode=LakehouseOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Lakehouse operation failed for: Operation returned an invalid status code 'Unauthorized'. Workspace: 'WorkSpaceID'. Path: 'LakehouseID/Tables/SchemaName/TableName/8e41ff8f-919c-45c0-b62d-1798a0cb03ce_GUID.parquet'. ErrorCode: 'Unauthorized'. Message: 'Unauthorized'. TimeStamp: 'Mon, 17 Nov 2025 11:29:35 GMT'..,Source=Microsoft.DataTransfer.ClientLibrary,''Type=Microsoft.Azure.Storage.Data.Models.ErrorSchemaException,Message=Operation returned an invalid status code 'Unauthorized',Source=Microsoft.DataTransfer.ClientLibrary,'
Hi,
We are encountering the above error while running a Fabric Copy Activity. The issue occurs when copying data from SAP HANA into a Lakehouse.
The pipelines were running successfully earlier, but since last week we have started receiving the above error. Previously, we were able to use a LakehouseID. However, it appears that Fabric has introduced an update that now Connection for the Lakehouse.
Older Destination Setting:
New Destination Setting:
We investigated the issue further and identified that token expiration might be the root cause. When reviewing the Lakehouse connection that we recently created, we noticed that the authentication method is set to OAuth by default, and it appears to be the only available option.
can someone please help with the issue and the reason.?
9 Replies
- Vinodh247Super User
This seems like a fabric platform issue and fabric regression, not your config. Microsoft recently changed the Lakehouse destination to require a Lakehouse connection, and that connection now uses OAuth only. Pipelines cannot refresh oauth tokens, so once your user token expires, the copy activity fails with Unauthorized when writing to OneLake. It is not related to SAP hana/permissions.
Workarounds that you can try:
Avoid using the new Lakehouse connection (use manual table entry if still available).
Recreate the conn before each run (temp).
Raise a support ticket because the change broke non interactive pipeline loads.
- SivaReddy24680Advocate I
Vinodh247 Thanks for replying.
I'm trying the workarounds that you suggested
1. The connection still seems to be mandatory. Even when the Lakehouse is attached directly, Fabric asks for a connection to be created.
2. This approach works for small tables that run in a loop(can you please provide some info or document on how to refresh token using pipeline), but for large-volume tables the token expires in the middle of the extraction. We are planning to load these tables in chunks based on the date fields to avoid the issue.
- Vinodh247Super User
I am afraid there is no doc on “refreshing token using pipeline” because fabric does not support it. Oauth tokens for lakehouse conne are user based and expire silently during long running copy operations.