Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Alerod31
Frequent Visitor

Can´t save a table in a Warehouse with pyspark

Good morning,

I have a problem when saving a table in a warehouse using a notebook and pyspark. In this capacity, only my user works and has access to everything.

 

I try to use this code:

df.write.format("delta").save(url)

 

and the error I get is:

Caused by: Operation failed: "Forbidden", 403, PUT,  , AuthorizationPermissionMismatch, "This request is not authorized to perform this operation using this permission. RequestId: --- Time: ---"

 

However, if I do it from a data flow, it allows me to save correctly.

Please help!!

1 ACCEPTED SOLUTION
suparnababu8
Super User
Super User

Hi @Alerod31 

 

I think you don't have permission to write as table. make sure your accaunt has the right permisssions for the target storage location. If needed, check with your adminiistrator to confirm you have the prooper roles and access. Make sure the URL you are using in the save method is accurate and leads to the correct location. Try with follwing code again.

df.write.format("delta").save("url")

If you need more info pls go thorugh below urls. It might helps you to reolve your problem.

Solved: Re: Save a pyspark dataframe in a table in warehou... - Microsoft Fabric Community

apache spark - How to specify the path where saveAsTable saves files to? - Stack Overflow

pyspark.sql.DataFrameWriter.saveAsTable — PySpark 3.5.5 documentation

 

Thank you!

 

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

View solution in original post

4 REPLIES 4
v-achippa
Community Support
Community Support

Hi @Alerod31,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Thank you @suparnababu8 for the prompt response.

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the super user resolved your issue? or let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @Alerod31,

 

We wanted to kindly follow up to check if the solution provided by the super user resolved your issue.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @Alerod31,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the super user resolved your issue.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

suparnababu8
Super User
Super User

Hi @Alerod31 

 

I think you don't have permission to write as table. make sure your accaunt has the right permisssions for the target storage location. If needed, check with your adminiistrator to confirm you have the prooper roles and access. Make sure the URL you are using in the save method is accurate and leads to the correct location. Try with follwing code again.

df.write.format("delta").save("url")

If you need more info pls go thorugh below urls. It might helps you to reolve your problem.

Solved: Re: Save a pyspark dataframe in a table in warehou... - Microsoft Fabric Community

apache spark - How to specify the path where saveAsTable saves files to? - Stack Overflow

pyspark.sql.DataFrameWriter.saveAsTable — PySpark 3.5.5 documentation

 

Thank you!

 

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.