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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
tareksalha
Frequent Visitor

create view via spark sql

I am trying to execute the following statement inside of a notebook 

 

%%sql
CREATE VIEW data_lake.data_vault.table2_current
AS
SELECT *
FROM data_lake.data_vault.table1

the statement terminates with an error saying:

If you are using a StorageSharedKeyCredential, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate method call.
If you are using a SAS token, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.
Please remember to disable 'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.
Status code 403, "{"error":{"code":"AuthorizationPermissionMismatch","message":"This request is not authorized to perform this operation using this permission.\nRequestId:fcb75810-d01f-0041-72ff-a92006000000\nTime:2025-04-10T10:00:54.4871285Z"}}"
java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)

 

data_lake is the name of my lakehouse. What am I missing here? I am admin of the workspace

1 ACCEPTED SOLUTION

Hi @tareksalha ,
Thanks for reaching out to the Microsoft fabric community forum.

As you are using Lakehouse with schema enabled which is still in preview phase some of the features are not supported yet and one them is creation of views.
That is the reason for the error you are observing.
Reference for the above point: Lakehouse schemas (Preview) - Microsoft Fabric | Microsoft Learn

vnmadadimsft_0-1745128919930.png

 



If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards


View solution in original post

7 REPLIES 7
v-nmadadi-msft
Community Support
Community Support

Hi @tareksalha ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Thank you

Hi @v-nmadadi-msft,

thank you for guiding me to the root of the problem.

when not using a schema-enabled lakehouse, it will work then?

v-nmadadi-msft
Community Support
Community Support

Hi @tareksalha,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

hi there,
today I had the chance to test your proposed solution. I checked, that data_lake is set as the default lakehouse. Also, I checked both the workspace and lakehouse permissions and all looks good.

Unfortunately, your modified code does not work as well, but with different error:

assertion failed: Only the following table types are supported: MANAGED, MATERIALIZED_VIEW
scala.Predef$.assert(Predef.scala:223)
com.microsoft.fabric.spark.catalog.metadata.v202405.TableMetadataManagerV202405.createTable(TableMetadataManagerV202405.scala:95)
com.microsoft.fabric.spark.catalog.metadata.MetadataManager.createTable(MetadataManager.scala:235)
com.microsoft.fabric.spark.catalog.metadata.InstrumentedMetadataManager.super$createTable(MetadataManager.scala:370)
com.microsoft.fabric.spark.catalog.metadata.InstrumentedMetadataManager.$anonfun$createTable$1(MetadataManager.scala:370)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
com.microsoft.fabric.spark.catalog.metadata.Helpers$.timed(Helpers.scala:61)
com.microsoft.fabric.spark.catalog.metadata.InstrumentedMetadataManager.createTable(MetadataManager.scala:370)
com.microsoft.fabric.spark.catalog.OnelakeExternalCatalog.createTable(OnelakeExternalCatalog.scala:102)
com.microsoft.fabric.spark.catalog.InstrumentedExternalCatalog.$anonfun$createTable$3(OnelakeExternalCatalog.scala:434)

 

Interesting fact: the view has still been created, although the command errored out. But when I try to access the view and query it, It does not open with following error:

 

Server Error.
Message
The requested Lakehouse operation failed. A retry of the operation may help.
Error Code
LakehouseOperationFailed
Activity Id (Failed Request)
e56455f1-3925-4c87-9f84-2c77507ed803
Client Session Id
8501eff4-63b3-4d6e-80a4-e030df9fdfed
Activity ID (Initial Request)
764fafca-0689-474b-9935-c966480e4dc5
User session Id
cdfe8c46-09c1-4048-b97c-fe26c1a1814b

Hi @tareksalha ,
Thanks for reaching out to the Microsoft fabric community forum.

As you are using Lakehouse with schema enabled which is still in preview phase some of the features are not supported yet and one them is creation of views.
That is the reason for the error you are observing.
Reference for the above point: Lakehouse schemas (Preview) - Microsoft Fabric | Microsoft Learn

vnmadadimsft_0-1745128919930.png

 



If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards


Hi @tareksalha,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @tareksalha,
Thanks for reaching out to the Microsoft fabric community forum.

It appears you're encountering a 403 Forbidden error when attempting to create a view in your Fabric notebook. This error is commonly linked to authentication or permission issues.

First, ensure that the Lakehouse is set as the default for your notebook. This is important because some operations depend on having the correct context set, and not specifying the default Lakehouse can lead to namespace-related errors when executing SQL or Spark commands.

Next, verify that your user account has the appropriate permissions to interact with the Lakehouse. While being a workspace admin typically provides elevated access, certain actions like modifying metadata or creating views may require specific rights at the Lakehouse level. Double-check both workspace and Lakehouse permissions to ensure you have full access to perform these operations.

Finally, Modify the code in this format and check if this is working

%%sql

CREATE VIEW table2_current

AS

SELECT *

FROM data_lake.data_vault.table1

 


If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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