MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.29k stars 21.47k forks source link

This request is not authorized to perform this operation using this permission. #70324

Closed rawatsudhir1 closed 3 years ago

rawatsudhir1 commented 3 years ago

[Enter feedback here] I have given a user "System Administrator" role at "Workspace" scope. Assuming the user will have full rights When the user tries to login to synapse studio and run a pyspark notebook, gets following error.

Error Trace:- Py4JJavaError : An error occurred while calling o155.load. : Operation failed: "This request is not authorized to perform this operation using this permission.", 403, HEAD, https://synapsedlsg2demo.dfs.core.windows.net/synapsefilesystemdemo/user_data/userdata2.parquet?upn=false&action=getStatus&timeout=90 at org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.execute(AbfsRestOperation.java:166) at org.apache.hadoop.fs.azurebfs.services.AbfsClient.getPathStatus(AbfsClient.java:414) at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.getFileStatus(AzureBlobFileSystemStore.java:551) at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.getFileStatus(AzureBlobFileSystem.java:430) at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1627) at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary$1.apply(DataSource.scala:556) at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary$1.apply(DataSource.scala:544) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241) at scala.collection.immutable.List.foreach(List.scala:392) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241) at scala.collection.immutable.List.flatMap(List.scala:355) at org.apache.spark.sql.execution.datasources.DataSource.org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary(DataSource.scala:544) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:358) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:748) Traceback (most recent call last): File "/opt/spark/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 166, in load return self._df(self._jreader.load(path)) File "/opt/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1257, in call answer, self.gateway_client, self.target_id, self.name) File "/opt/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 69, in deco return f(*a, **kw) File "/opt/spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py", line 328, in get_return_value format(target_id, ".", name), value) py4j.protocol.Py4JJavaError: An error occurred while calling o155.load. : Operation failed: "This request is not authorized to perform this operation using this permission.", 403, HEAD, https://synapsedlsg2demo.dfs.core.windows.net/synapsefilesystemdemo/user_data/userdata2.parquet?upn=false&action=getStatus&timeout=90 at org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.execute(AbfsRestOperation.java:166) at org.apache.hadoop.fs.azurebfs.services.AbfsClient.getPathStatus(AbfsClient.java:414) at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.getFileStatus(AzureBlobFileSystemStore.java:551) at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.getFileStatus(AzureBlobFileSystem.java:430) at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1627) at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary$1.apply(DataSource.scala:556) at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary$1.apply(DataSource.scala:544) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241) at scala.collection.immutable.List.foreach(List.scala:392) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241) at scala.collection.immutable.List.flatMap(List.scala:355) at org.apache.spark.sql.execution.datasources.DataSource.org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary(DataSource.scala:544) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:358) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:748)

The Code:- %%pyspark df = spark.read.load('abfss://XXXXX@YYYYYY.dfs.core.windows.net/user_data/sampledata.parquet', format='parquet') display(df.limit(10))

Any idea?

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

KranthiPakala-MSFT commented 3 years ago

@rawatsudhir1 Thanks for reaching out. Could you please try by granting Synapse Compute Operator permissions role on the workspace for the same user and see if that helps.

image

Thank you.

KranthiPakala-MSFT commented 3 years ago

Hi @rawatsudhir1, following up to see if you have got a chance to try the above suggestion?

Thanks

rawatsudhir1 commented 3 years ago

Hi @KranthiPakala-MSFT,

Given the required access as screenshot below

image

It failed with same error

image

KranthiPakala-MSFT commented 3 years ago

Hi @rawatsudhir1 , Thanks for sharing additional information. Looks like it is ADLSGen2 access issue for the user.

To enable other users to use the storage account after you create your workspace, you will have to perform below tasks:

This is notified while creating the workspace.

image

Let us know how it goes.

Thank you

KranthiPakala-MSFT commented 3 years ago

Based on the above suggestion @rawatsudhir1 was able to resolve the issue. The user doesn't have access to ADLS Gen2 which is why the error is thrown. After granting the storage permission to the user, the issue is resolved.

Based on this update, we will now proceed to close this thread.

Thank you

sahu-G commented 1 year ago

Thanks